개발공부/LeetCode

    [JavaScript] 991. Broken Calculator 쉬운 설명

    991. Broken Calculator There is a broken calculator that has the integer startValue on its display initially. In one operation, you can: multiply the number on display by 2, or subtract 1 from the number on display. Given two integers startValue and target, return the minimum number of operations needed to display target on the calculator. Example 1: Input: startValue = 2, target = 3 Output: 2 E..

    [Javascript] 1663. Smallest String With A Given Numeric Value -쉬운 설명

    [Javascript] 1663. Smallest String With A Given Numeric Value -쉬운 설명

    1663. Smallest String With A Given Numeric Value The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on. The numeric value of a string consisting of lowercase characters is defined as the sum of its characters' numeric values. For example, the numeric va..

    [JavaScript] 36. Valid Sudoku

    36. Valid Sudoku to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must contain the digits 1-9 without repetition. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition. Note: A Sudoku board (partially filled) could be valid but is not necessarily solvable. Only the filled cells need to be ..

    [JavaScript] 49. Group Anagrams 쉬운설명, hasmap사용

    49. Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: strs = ["eat","tea","tan","ate","nat","bat"] Output: [["bat"],["nat","tan"],["ate","eat","tea"]] Example 2: I..