TheRealSamuel/LeetCodeProblem
0574
1{2 "id": 3568,3 "name": "find_the_key_of_the_numbers",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/find-the-key-of-the-numbers/",6 "date": "2024-08-17 00:00:00",7 "task_description": "You are given three **positive** integers `num1`, `num2`, and `num3`. The `key` of `num1`, `num2`, and `num3` is defined as a four-digit number such that: Initially, if any number has **less than** four digits, it is padded with **leading zeros**. The `ith` digit (`1 <= i <= 4`) of the `key` is generated by taking the **smallest** digit among the `ith` digits of `num1`, `num2`, and `num3`. Return the `key` of the three numbers **without** leading zeros (_if any_). **Example 1:** **Input:** num1 = 1, num2 = 10, num3 = 1000 **Output:** 0 **Explanation:** On padding, `num1` becomes `\"0001\"`, `num2` becomes `\"0010\"`, and `num3` remains `\"1000\"`. The `1st` digit of the `key` is `min(0, 0, 1)`. The `2nd` digit of the `key` is `min(0, 0, 0)`. The `3rd` digit of the `key` is `min(0, 1, 0)`. The `4th` digit of the `key` is `min(1, 0, 0)`. Hence, the `key` is `\"0000\"`, i.e. 0. **Example 2:** **Input:** num1 = 987, num2 = 879, num3 = 798 **Output:** 777 **Example 3:** **Input:** num1 = 1, num2 = 2, num3 = 3 **Output:** 1 **Constraints:** `1 <= num1, num2, num3 <= 9999`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "num1 = 1, num2 = 10, num3 = 1000",12 "output": "0 "13 },14 {15 "label": "Example 2",16 "input": "num1 = 987, num2 = 879, num3 = 798",17 "output": "77"18 },19 {20 "label": "Example 3",21 "input": "num1 = 1, num2 = 2, num3 = 3",22 "output": ""23 }24 ],25 "private_test_cases": [26 {27 "input": [28 3429,29 6843,30 217631 ],32 "output": 212333 },34 {35 "input": [36 6723,37 3143,38 971839 ],40 "output": 311341 },42 {43 "input": [44 6202,45 6801,46 8247 ],48 "output": 149 },50 {51 "input": [52 6316,53 146,54 236155 ],56 "output": 11157 },58 {59 "input": [60 6735,61 1609,62 364163 ],64 "output": 160165 },66 {67 "input": [68 5794,69 3525,70 975971 ],72 "output": 352473 },74 {75 "input": [76 4306,77 8223,78 750479 ],80 "output": 420381 },82 {83 "input": [84 938,85 9737,86 957687 ],88 "output": 53689 },90 {91 "input": [92 3514,93 6610,94 448995 ],96 "output": 341097 },98 {99 "input": [100 3258,101 195,102 3600103 ],104 "output": 100105 }106 ],107 "haskell_template": "generateKey :: Int -> Int -> Int -> Int\ngenerateKey num1 num2 num3 ",108 "ocaml_template": "let generateKey (num1: int) (num2: int) (num3: int) : int = ",109 "scala_template": "def generateKey(num1: Int,num2: Int,num3: Int): Int = { \n \n}",110 "java_template": "class Solution {\n public int generateKey(int num1, int num2, int num3) {\n \n }\n}",111 "python_template": "class Solution(object):\n def generateKey(self, num1, num2, num3):\n \"\"\"\n :type num1: int\n :type num2: int\n :type num3: int\n :rtype: int\n \"\"\"\n "112}