본문 바로가기

코딩테스트/LeetCode20

[LeetCode] 순열 https://leetcode.com/problems/permutations/ Permutations - LeetCode Can you solve this real interview question? Permutations - Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1], leetcode.com 문제해설: 사용자가 리스트를 입력하면 순열을 구하는 문제이다. [1,2,3]을 받았다면 이것을 이용해 [1,2,3.. 2023. 10. 21.
[LeetCode] topKFrequent(상위 K 빈도 요소) https://leetcode.com/problems/top-k-frequent-elements/submissions/1079747150/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 해설: 문자의 갯수가 k번 이상 등장하는 갯수를 구한다. * 받아온 리스트의 문자들의 갯수를 써준다. * 딕셔너리의 value가 빈도수이기 때문에 value순으로 가장 .. 2023. 10. 21.
[LeetCode] numJewelsInStones(보석과 돌) https://leetcode.com/problems/jewels-and-stones/ Jewels and Stones - LeetCode Can you solve this real interview question? Jewels and Stones - You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to kno leetcode.com 문제설명 문자열을 사용자가 입력하면 문자열(돌)에 얼마나 그 문자가 들어가있는지 확인하는 .. 2023. 10. 21.
[LeetCode] Longest Substring Without Repeating Characters( 중복 문자 없는 가장 긴 부분 문자열 ) https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ 2023. 10. 20.