Eat Study Love

먹고 공부하고 사랑하라

programming practice 30

Remove loop in Linked List(Linked List,two-pointer,algorithm,Data Structures,Algorithms) - 플로이드의 사이클 감지 알고리즘 (Floyd's Cycle Detection Algorithm)

https://www.geeksforgeeks.org/problems/remove-loop-in-linked-list/1?page=1&category=Linked%20List&difficulty=Medium,Hard&sortBy=submissions Remove loop in Linked List | Practice | GeeksforGeeksGiven the head of a linked list that may contain a loop.  A loop means that the last node of the linked list is connected back to a node in the same list.  So if the next of the previous node is null. then..

Coding_Practice 2024.12.17

Construct String With Repeat Limit(Hash Table,String,Greedy,Heap (Priority Queue)Counting)

https://leetcode.com/problems/construct-string-with-repeat-limit/description/?envType=daily-question&envId=2024-12-17You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use all characters from s.Return the lexicographically largest repeatLimit..

Coding_Practice 2024.12.17

Final Array State After K Multiplication Operations I(Array,Math,Heap (Priority Queue),Simulation)

https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/description/?envType=daily-question&envId=2024-12-16You are given an integer array nums, an integer k, and an integer multiplier.You need to perform k operations on nums. In each operation:Find the minimum value x in nums. If there are multiple occurrences of the minimum value, select the one that appears first.R..

Coding_Practice 2024.12.16

Next Greater Element I(Array,Hash Table,Stack,Monotonic Stack)

https://leetcode.com/problems/next-greater-element-i/description/The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.For each 0  j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums..

Coding_Practice 2024.12.03

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

Is Graph Bipartite?[Depth-First Search,Breadth-First Search,Union Find,Graph]

https://leetcode.com/problems/is-graph-bipartite/description/?envType=problem-list-v2&envId=graphThere is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has the f..

Coding_Practice 2024.10.28

Count the Number of Good Subarrays[M,Array,Hash Table,Sliding Window]

https://leetcode.com/problems/count-the-number-of-good-subarrays/description/Given an integer array nums and an integer k, return the number of good subarrays of nums.A subarray arr is good if it there are at least k pairs of indices (i, j) such that i  and arr[i] == arr[j].A subarray is a contiguous non-empty sequence of elements within an array. Example 1:Input: nums = [1,1,1,1,1], k = 10Outpu..

Coding_Practice 2024.09.11