Eat Study Love

먹고 공부하고 사랑하라

코딩공부 55

MinMaxDivision(Divide array A into K blocks and minimize the largest sum of any block)

https://app.codility.com/programmers/lessons/14-binary_search_algorithm/min_max_division/ MinMaxDivision coding task - Learn to Code - CodilityDivide array A into K blocks and minimize the largest sum of any block.app.codility.comYou are given integers K, M and a non-empty array A consisting of N integers. Every element of the array is not greater than M.You should divide this array into K block..

Coding_Practice 2024.10.16

Longest Nice Substring[Hash Table,String,Divide and Conquer,Bit Manipulation,Sliding Window]

https://leetcode.com/problems/longest-nice-substring/description/A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.Given a string s, return the longest substring of s that is nice. If there ..

Coding_Practice 2024.10.10

Count Complete Tree Nodes[Binary Search,Bit Manipulation,Tree,Binary Tree]

https://leetcode.com/problems/count-complete-tree-nodes/description/Given the root of a complete binary tree, return the number of the nodes in the tree.According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.Design a..

Coding_Practice 2024.09.26

Sum of Prefix Scores of Strings[Array,String,Trie,Counting]

https://leetcode.com/problems/sum-of-prefix-scores-of-strings/description/?envType=daily-question&envId=2024-09-25You are given an array words of size n consisting of non-empty strings.We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i].For example, if words = ["a", "ab", "abc", "cab"], then the score of "ab" is 2, since "ab" is a prefix ..

Coding_Practice 2024.09.25

Find the Length of the Longest Common Prefix[M,Array,Hash Table,String,Trie]

https://leetcode.com/problems/find-the-length-of-the-longest-common-prefix/description/?envType=daily-question&envId=2024-09-24You are given two arrays with positive integers arr1 and arr2.A prefix of a positive integer is an integer formed by one or more of its digits, starting from its leftmost digit. For example, 123 is a prefix of the integer 12345, while 234 is not.A common prefix of two in..

Coding_Practice 2024.09.24