Eat Study Love

먹고 공부하고 사랑하라

Coding_Practice 143

Sort Characters By Frequency(Hash Table,String,Sorting,Heap (Priority Queue),Bucket Sort,Counting)

https://leetcode.com/problems/sort-characters-by-frequency/description/Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.Return the sorted string. If there are multiple answers, return any of them. Example 1:Input: s = "tree"Output: "eert"Explanation: 'e' appears twice while 'r' and..

Coding_Practice 2024.11.18

Generate Parentheses[String,Dynamic Programming,Backtracking]

https://leetcode.com/problems/generate-parentheses/description/Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1:Input: n = 3Output: ["((()))","(()())","(())()","()(())","()()()"]Example 2:Input: n = 1Output: ["()"] Constraints:1 간단한 Dynamic Programming 코딩 한 번 해보기!문제는 쉬워 보이나, 막상 코딩하려니까 좀 짜친다.  1. Python아래까지 풀다가 GG. 뭔가 뒤에 방법이 생각 안 난다..

Coding_Practice 2024.11.14

Min Cost to Connect All Points(Array,Union Find,Graph,Minimum Spanning Tree)

https://leetcode.com/problems/min-cost-to-connect-all-points/description/You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].The cost of connecting two points [xi, yi] and [xj, yj] is the manhattan distance between them: |xi - xj| + |yi - yj|, where |val| denotes the absolute value of val.Return the minimum cost to make all poin..

Coding_Practice 2024.11.12

Minimum One Bit Operations to Make Integers Zero[Dynamic Programming,Bit Manipulation,Memoization]

https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero/description/Given an integer n, you must transform it into 0 using the following operations any number of times:Change the rightmost (0th) bit in the binary representation of n.Change the ith bit in the binary representation of n if the (i-1)th bit is set to 1 and the (i-2)th through 0th bits are set to 0.Return the m..

Coding_Practice 2024.11.08