딕셔너리

    [LeetCode] 1165. Single-Row Keyboard

    1165. Single-Row Keyboard Easy There is a special keyboard with all keys in a single row. Given a string keyboard of length 26 indicating the layout of the keyboard (indexed from 0 to 25). Initially, your finger is at index 0. To type a character, you have to move your finger to the index of the desired character. The time taken to move your finger from index i to index j is |i - j|. You want to..

    [LeetCode] 380. Insert Delete GetRandom O(1)

    380. Insert Delete GetRandom O(1) Medium Implement the RandomizedSet class: RandomizedSet() Initializes the RandomizedSet object. bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise. bool remove(int val) Removes an item val from the set if present. Returns true if the item was present, false otherwise. int getRandom() Re..

    [LeetCode] 246. Strobogrammatic Number

    246. Strobogrammatic Number Easy Given a string num which represents an integer, return true if num is a strobogrammatic number. A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Example 1: Input: num = "69" Output: true Example 2: Input: num = "88" Output: true Example 3: Input: num = "962" Output: false Constraints: 1

    [LeetCode - Biweekly Contest 90] 2453. Destroy Sequential Targets

    2453. Destroy Sequential Targets Medium You are given a 0-indexed array nums consisting of positive integers, representing targets on a number line. You are also given an integer space. You have a machine which can destroy targets. Seeding the machine with some nums[i] allows it to destroy all targets with values that can be represented as nums[i] + c * space, where c is any non-negative integer..

    [LeetCode - Biweekly Contest 90] 2451. Odd String Difference

    2451. Odd String Difference Easy You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a difference integer array difference[i] of length n - 1 where difference[i][j] = words[i][j+1] - words[i][j] where 0

    [LeetCode] 49. Group Anagrams

    49. Group Anagrams Medium 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"]] Examp..