Cara menggunakan compare string list python

Python Lambda functions are functions that do not have any name. Hence they are also known as anonymous or nameless functions. The word ‘lambda’ is a keyword. The function that follows the ‘lambda’ keyword is anonymous.

As mentioned already, a lambda function can take any number of arguments but a single expression. Hence the number of arguments ranges from 0 to any number.

Here is an example to print the square root of a number.

x – is the argument.

x**[1/2] – The expression that gets evaluated.

lambda x:x**[1/2] – anonymous function which returns a function object.

Below is an example of a python lambda function that accepts multiple parameters.

When we write the same example using normal functions, which will take more lines. For instance,

You might get this question, when we say lambda as nameless functions, then why we need to assign lambda function to some variable and call the lambda function using a variable. In general, we use lambda functions with higher-order functions and built-in functions like filter, map, reduce, etc.,

In the above example, the function func[] returns a lambda function. Whenever we call the func[], we make use of the lambda function.

The filter function filters the iterable with the help of another function. The filter function takes the function to filter the iterable and iterable as an argument.

Let’s see an example to filter the even numbers from the list.

The map function applies a function to all the values in an iterable. The map function takes the function to be applied to the iterable and iterable as an argument.

Get the even numbers from a list using the map function.

The reduce function applies a function to all the values of an iterable and returns a single number. The reduce function takes the function and iterable as an argument.

Get the product of all the numbers in a list.

S.NoInterview QuestionNumber of times has been asked1 Delete a node in doubly linked list 2862 2 Java program to find the number of Nodes in a Binary Tree 2528 3 Reverse a string without affecting special characters 2503 4 Palindrome using Recursion 2469 5 Delete a node of a linked list at given position 2004 6 Quick Sort 1754 7 Insert nodes in a linked list in a sorted way [Ascending Order] 1689 8 Find elements pair from array whose sum equal to number 1672 9 Sort Elements by Frequency of Occurrences 1657 10 Write a program to print all permutations of a given string 1640 11 Find Minimum Distance Between Two Numbers in an Array 1501 12 Create a Doubly Linked List 1472 13 Reverse an Array 1446 14 Smallest window in a string containing all characters of another string 1421 15 Recursively remove all adjacent duplicates 1390 16 Find a Triplet That Sum to a Given Value 1379 17 First Repeating Element 1370 18 Sum of numbers in String 1348 19 Arrange Even and Odd number such that Odd comes after Even 1343 20 Smallest Positive Number Missing in an Unsorted Array 1309 21 Check if the Elements of an Array are Consecutive 1278 22 Detect a loop in the Linked List 1262 23 Largest Sum Contiguous Subarray 1250 24 Quick Sort on SIngly Linked List 1244 25 Print all Possible Combinations of R Elements in a given Array of size N 1235 26 Subarray with Given Sum 1233 27 Recursive function to do substring search 1231 28 Find the Maximum Repeating Number in Array 1189 29 Binary Tree Level order traversal in Java 1146 30 Find the First and Second Smallest Elements 1138 31 Check if two linked lists are identical 1131 32 Maximum Subarray Sum using Divide and Conquer 1127 33 Remove characters from first string which are in second 1097 34 Find Leaders in an Array 1080 35 Swap nodes in the linked list 1066 36 Find the Number Occurring Odd Number of Times in an Array 1024 37 Find the second most frequent character 1018 38 Arrange given Numbers to Form the Biggest Number II 1012 39 Given a string find its first non-repeating character 997 40 Find Triplet in Array With a Given Sum 988 41 Given a sorted array and a number x, find the pair in array whose sum is closest to x 977 42 A Program to check if strings are rotations of each other or not 976 43 Total number of occurrences of a given item in the linked list 975 44 Print all possible words from phone digits 959 45 Find the Missing Number 950 46 Rearrange Positive and Negative Numbers Alternatively in Array 940 47 Longest Palindromic Substring 930 48 Segregate even and odd nodes in a linked list 918 49 Print Longest common subsequence 910 50 Transform one string to another using minimum number of given operations 898 51 Union and Intersection of Two Linked Lists 894 52 Check rearranged string can form a palindrome 879 53 Rearrange given Array in Maximum Minimum Form 864 54 Iterative Implementation of Quick Sort 853 55 Insertion Sort 847 56 Count Possible Triangles 844 57 Multiplication of Two Matrices 831 58 Count of Triplets With Sum Less than Given Value 818 59 Check if the linked list is palindrome 817 60 Rotate a Linked List 815 61 Stock Buy Sell to Maximize Profit 813 62 Concatenation of two strings 790 63 Tug of War 783 64 Print all duplicates in the input string 782 65 Count Number of Substrings with K Distinct Character’s 782 66 Find Nearest Greater and Smaller Element 769 67 Reverse String Without Temporary Variable 760 68 The Celebrity Problem 759 69 Remove ‘b’ and ‘ac’ from a given string 758 70 Find Pythagorean Triplets from Array 756 71 Find all Common Elements in Given Three Sorted Arrays 747 72 Remove all duplicates in an unsorted linked list 729 73 Find the Row with Maximum Number of 1’s 725 74 Find the subarray whose sum is equal to a given number X 722 75 Remove Minimum Characters so that Two Strings Become Anagrams 721 76 Find the Peak Element from an Array 719 77 Find Smallest Missing Number in a Sorted Array 713 78 Addition of Two Matrices 710 79 Generate all Binary Strings Without Consecutive 1’s 709 80 A Product Array Puzzle 708 81 Maximum Sum of Non Consecutive Elements 696 82 Implement Two Stacks in an Array 695 83 Lexicographic rank of string 681 84 Maximum Product Subarray II 678 85 Check if Two given Matrices are Identical 676 86 Multiplication of Previous and Next 668 87 Subtraction of Two Matrices 661 88 Move All the Zeros to the End of the Given Array 656 89 Online Algorithm for Checking Palindrome in a Stream 654 90 Merge K Sorted Arrays and Print Sorted Output 653 91 Divide a string in N equal parts 653 92 Form Minimum Number from Given Sequence of D’s and I’s 646 93 Check whether two strings are anagram of each other 645 94 Remove recurring digits in a given number 640 95 Sort a stack using a temporary stack 634 96 Sort a linked list that is sorted alternating ascending and descending 633 97 Maximum Circular Subarray Sum 631 98 Find the Minimum Element in a Sorted and Rotated Array 626 99 Move last element of the Linked List at first place 624 100 Subarray and Subsequence 624 101 First Circular Tour to Visit all the Petrol Bunks 620 102 Compare two strings[linked lists] 616 103 Largest Subarray with Equal Number of 0’s and 1’s 615 104 Maximum Element in an Array which is Increasing and then Decreasing 614 105 Flattening a linked list 613 106 Palindrome Permutations of a String 613 107 3Sum Leetcode Solution 609 108 Palindromes in a given range 604 109 Minimum insertions to form a shortest palindrome 604 110 Run length encoding 602 111 Elements Appear more than N/K times in Array 601 112 Print all permutations with repetition 601 113 Majority Element 600 114 Pangram Checking 600 115 Minimum Characters to be Added at Front to Make String Palindrome 594 116 Rotate string to get lexicographically minimum string 590 117 Most repeating character in a string 590 118 Repeated Subsequence of Length Two or More 587 119 Merge a linked list into another at alternate positions 587 120 Rearrange a given linked list in-place 585 121 Remove all duplicates in a sorted linked list 585 122 Minimum number of Merge Operations to make an Array Palindrome 581 123 Two Sum Leetcode Solution 580 124 Print all anagrams together in a sequence of words 578 125 Reorder an Array According to the Given Indexes 568 126 Pancake Sorting Problem 566 127 Merge Overlapping Intervals II 557 128 Clone a Linked List with next and random pointer 556 129 Transpose of a Matrix 553 130 Remove Extra Spaces from a String 549 131 Smallest Palindrome after Replacement 549 132 Remove duplicates from a string 549 133 Size of The Subarray With Maximum Sum 549 134 Removing Spaces from a String using stringstream 547 135 Longest Palindrome can be Formed by Removing or Rearranging Characters 546 136 Check if a given string is a rotation of a palindrome 546 137 Maximum Sum Increasing Subsequence 543 138 Partition Problem 539 139 Generate all Binary Strings from Given Pattern 533 140 Check whether Strings are K Distance Apart or Not 532 141 Length of Longest valid Substring 527 142 Delete Last Occurrence 525 143 Find Zeros to be Flipped so that Number of Consecutive 1’s is Maximized 522 144 Check if Two given Strings are Isomorphic to each other 522 145 Insert Node in the Sorted Linked List 519 146 Program to Toggle all Characters in a String 512 147 Given string is interleaving of two other strings or not 512 148 Maximum difference between two elements such as larger element comes after smaller 511 149 Count Minimum Steps to Get the given Array 502 150 Check length of a String is Equal to the Number Appended at its Last 499 151 Number of Smaller Elements on Right Side 497 152 Merge sort better than quick sort for linked lists 495 153 Check if all Rows of a Matrix are Circular Rotations of Each Other 495 154 Longest Common Prefix using Divide and Conquer 495 155 Find Pair with Given Difference 494 156 Find nth node of the Linked list from the end 490 157 Print all interleavings of given two strings 486 158 Compare Two Version Numbers 486 159 Find a Fixed Point in a Given Array 481 160 Median of Two Sorted Arrays LeetCode Solution 480 161 Print Reverse of a string [Recursion] 480 162 Sort 0s 1s and 2s in an Array 480 163 Reverse words in a given string 480 164 Reorder Array Using Given Indexes 478 165 Merge two sorted linked lists such that merged list is in reverse order 474 166 Find the Subarray of given length with Least Average 473 167 Split linked list using alternate nodes 473 168 Print string of odd length in ‘X’ format 462 169 Print all Palindromic Partitions of a String 461 170 Find Element Using Binary Search in Sorted Array 455 171 Swap Kth Node from beginning with Kth Node from End 454 172 Find K Length Subarray of Maximum Average 452 173 Find Duplicates in an Array in Most Efficient Way 446 174 print all palindromic partitions 442 175 Shortest Superstring Problem 442 176 Check if String Follows Order of Characters by a Pattern or not 439 177 Flatten a multilevel linked list 436 178 Maximum Length of Chain Pairs 435 179 Sort a String According to Another String 433 180 Sorting a K Sorted Array 431 181 Longest Span with same Sum in two Binary Arrays II 419 182 Program to add two binary digits 418 183 Reverse a Linked List in groups 417 184 Find a Sorted Subsequence of size 3 416 185 Recursively print all the sentences that can be formed from list of word lists 416 186 Longest Common Prefix Using Binary Search II 415 187 Find the two Numbers with Odd Occurrences in an Unsorted Array 410 188 Caesar Cipher 410 189 Reverse a Singly Linked List [Iterative/Non-Recursive] 410 190 Kth Non-repeating Character 408 191 Check if String can Become Empty by Recursively Deleting given Substring 403 192 Rearrange a linked list in Zig-Zag 400 193 Longest Common Prefix Word by Word Matching 398 194 Permutations of a Given String Using STL 395 195 Pancake Sorting 393 196 Rotate Image by 90 degrees 393 197 Perfect Reversible String 392 198 Find First non-repeating character in a string 389 199 Merging Two Sorted Arrays 388 200 Increasing Subsequence of Length three with Maximum Product 387 201 1`s and 2`s complement of binary number 385 202 List items containing all characters of a given word 381 203 Find the point where a monotonically increasing function becomes positive first time 381 204 Sort a linked list with 0s, 1s and 2s 379 205 Four Elements that Sum to Given 378 206 Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes 378 207 Longest Common Prefix using Character by Character Matching 375 208 Delete N nodes after M 371 209 Palindrome string [number] 370 210 Count Number of Occurrences in a Sorted Array 370 211 Maximum occurring character in a string 369 212 Minimum Characters to be Removed to Make a Binary String Alternate 366 213 Split a string 365 214 Sorting the array of strings 362 215 Valid Parentheses LeetCode Solution 359 216 Recursive Implementation of atoi[] 359 217 Convert a String that is Repetition of a Substring of Length K 358 218 Even Substring Count 357 219 Check if a Linked list of Strings form a Palindrome 355 220 Convert string1 to string2 in one edit 350 221 Print All Distinct Elements of the Array 350 222 Print Shortest Path to Print a String on Screen 349 223 Reverse a singly linked list recursively 348 224 Find the first Repeating Number in a Given Array 348 225 Maximum Subarray Leetcode Solution 346 226 Nth Character in Concatenated Decimal String 345 227 Count the number of words 345 228 wildcard character matching 344 229 Reverse a String using Stack 343 230 Lower Case To Upper Case 342 231 Can we reverse a linked list in less than O[n] time ? 341 232 Binary Tree to Doubly linked list 339 233 Sort Elements by Frequency II 337 234 Matrix Chain Multiplication using Dynamic Programming 334 235 Merge Two Sorted Arrays 333 236 Find the Lost Element From a Duplicated Array 333 237 Split Four Distinct Strings 333 238 Longest Common Subsequence with Permutations 330 239 Find middle of the Linked List 327 240 Count the Pairs at Same Distance as in English Alphabets 326 241 Roman to Integer Leetcode Solution 319 242 Next Greater Element in an Array 316 243 Palindrome Permutation 315 244 Toeplitz Matrix 309 245 Word Search Leetcode Solution 308 246 Find Nth Node 306 247 N queen problem 304 248 Find All Pairs With a Given Difference 304 249 Searching a node in a Binary Search Tree 304 250 String[represents an integer] to value 301 251 Triplet from three linked lists with given sum 301 252 Print all Possible Ways to Break a String in Bracket Form 301 253 Types of Binary Tree 300 254 Change Gender of a given String 300 255 Reverse a String 300 256 Delete a Tree 299 257 Reverse Bits 299 258 Count Pairs With Given Sum 297 259 How to Efficiently Implement k Stacks in a Single Array? 297 260 Sort an array of strings 296 261 Delete a node under given conditions 296 262 First non Repeating Element 296 263 Repeated Substring Pattern 295 264 Number of sub-strings which recursively add up to 9 294 265 Number of Islands LeetCode Solution 294 266 Binary Tree 291 267 Longest Common Extension 290 268 Move all negative elements to one side of array 290 269 Longest Palindromic Substring LeetCode Solution 290 270 Min Stack 288 271 Meeting Rooms II LeetCode Solution 288 272 Fibonacci numbers 287 273 Remove spaces from a string 286 274 Most Frequent Element in an Array 285 275 Dijkstra Algorithm 284 276 Cuckoo sequence program 283 277 Remove middle points in a linked list of line segments 281 278 Sudoku Solver 280 279 Shuffle a given Array 279 280 Max stack 279 281 Word Search 279 282 Find, second, frequent, character 278 283 House Robber Leetcode Solution 276 284 Minimize the maximum difference between the heights 274 285 KMP Algorithm 272 286 Expression Evaluation 272 287 Subset Leetcode 270 288 Number Of 1 bits 269 289 Search Insert Position Leetcode Solution 269 290 Plus One Leetcode Solution 267 291 Reverse words in a string 267 292 Combination Sum Leetcode Solution 266 293 Evaluation of Postfix Expression 265 294 Valid Palindrome Leetcode Solution 263 295 Sort linked which is sorted on absolute values 263 296 Set Matrix Zeroes 263 297 Clone a linked list with next and random pointer [Hashing] 263 298 Pair of Positive Negative Values in an Array 262 299 Min Stack Leetcode Solution 262 300 Subarray with 0 sum 260 301 Backspace String Compare 259 302 Rabin Karp Algorithm 258 303 How to Delete a Linked List 257 304 Merge Sorted Arrays Leetcode Solution 257 305 Common elements in all rows of a given matrix 256 306 Reversing a Queue 255 307 Sqrt[x] Leetcode Solution 253 308 Contains Duplicate 252 309 Tower Of Hanoi 252 310 Combination Sum 249 311 Contains Duplicate II Leetcode Solution 249 312 Delete middle element of a stack 249 313 Implementation of Deque using Doubly Linked List 248 314 Intersection of Two Arrays II Leetcode Solution 248 315 Find Top K [or Most Frequent] Numbers in a Stream 248 316 Count of index pairs with equal elements in an array 248 317 Pascal Triangle Leetcode 247 318 Count subarrays with equal number of 1’s and 0’s 247 319 Product of array except self 247 320 Integer to Roman Leetcode Solution 246 321 String Compression 246 322 Minimum swaps required to bring all elements less than or equal to k together 246 323 Segregate even and odd numbers 246 324 Sliding Window Technique 246 325 Count Odd Numbers in an Interval Range Leetcode Solution 245 326 Reverse individual words 245 327 Page Replacement Algorithms in Operating Systems 243 328 Arithmetic Expression Evaluation 243 329 Find sum of non-repeating elements [distinct] elements in an array 243 330 Bellman Ford Algorithm 243 331 Second Most Repeated Word in a Sequence 242 332 Single Number Leetcode Solution 241 333 Add Binary Leetcode Solution 241 334 Construct Binary Tree from Given Inorder and Preorder Traversals 240 335 Group Words With Same Set of Characters 240 336 Postfix to Infix Conversion 240 337 Pow[x, n] Leetcode Solution 239 338 Minimum Value to Get Positive Step by Step Sum Leetcode Solution 239 339 Sum of minimum and maximum elements of all subarrays of size k 239 340 Palindrome Linked List Leetcode Solution 239 341 Given two unsorted arrays find all pairs whose sum is x 239 342 Next Permutation 238 343 Smallest Subarray with k Distinct Numbers 238 344 Count subarrays having total distinct elements same as original array 238 345 Sorting array using Stacks 237 346 K-th Smallest Element in a Sorted Matrix 237 347 Maximum Number of Balloons Leetcode Solution 237 348 Longest Common Prefix Leetcode Solution 236 349 Kruskal Algorithm 236 350 Top K Frequent Words 236 351 Minimum operation to make all elements equal in array 236 352 Sort elements by frequency 236 353 Design a stack that supports getMin[] in O[1] time and O[1] extra space 235 354 Convex Hull Algorithm 235 355 First element occurring k times in an array 235 356 Majority Element Leetcode Solution 234 357 Permutations Leetcode Solution 233 358 Scramble String 233 359 Special Number 232 360 Evaluate Division 231 361 Find Lucky Integer in an Array Leetcode Solution 231 362 Longest Substring Without Repeating Characters LeetCode Solution 230 363 Check if two arrays are equal or not 230 364 Spiral Matrix LeetCode Solution 229 365 Find duplicates in a given array when elements are not limited to a range 229 366 Reversing the First K elements of a Queue 229 367 Minimum Path Sum 229 368 Find the Town Judge Leetcode Solution 229 369 Maximal Square 228 370 Third Maximum Number Leetcode Solution 228 371 Running Sum of 1d Array Leetcode Solution 228 372 Prefix to Infix Conversion 228 373 Maximum Subarray 228 374 Group Anagrams 227 375 Fizz Buzz Leetcode 227 376 Swap Nodes in Pairs Leetcode Solutions 227 377 Number of Good Pairs Leetcode Solution 227 378 Maximum possible difference of two subsets of an array 227 379 Minimum Absolute Difference Leetcode Solution 227 380 Find Numbers with Even Number of Digits Leetcode Solution 226 381 Single Number 226 382 Minimum Steps to reach target by a Knight 225 383 Reverse a Number Using Stack 224 384 Find All Numbers Disappeared in an Array Leetcode Solution 224 385 Maximum Distance Between two Occurrences of Same Element in Array 224 386 Find the first repeating element in an array of integers 223 387 Power of Two Leetcode Solution 223 388 Range Sum Query 2D – Immutable Leetcode Solution 223 389 Unique Paths 223 390 Huffman Coding 223 391 Convert String To Int 223 392 Leetcode Permutations 222 393 Top K Frequent Elements 222 394 Count Primes Leetcode Solutions 222 395 Pascal’s Triangle II Leetcode Solution 222 396 Merge Two Sorted Lists Leetcode Solutions 222 397 Sorting using trivial hash function 222 398 Palindrome Substring Queries 222 399 Find the Closest Palindrome number 221 400 Cumulative Frequency of Count of Each Element in an Unsorted Array 221 401 House Robber II Leetcode Solution 221 402 Find top three repeated in array 221 403 Sort Array by Increasing Frequency Leetcode Solution 221 404 Find Number of Employees Under every Employee 221 405 Missing Number Leetcode Solution 221 406 Implement Stack and Queue using Deque 221 407 Find Median from data Stream 220 408 Bipartite Graph 220 409 Zigzag Conversion 220 410 Check if Array Contains Contiguous Integers With Duplicates Allowed 220 411 How to Implement Stack Using Priority Queue or Heap? 220 412 Expression Contains Redundant Bracket or Not 220 413 Smallest Element Repeated Exactly K Times 220 414 Difference between highest and least frequencies in an array 219 415 Letter Case Permutation 219 416 Maximum Depth of Binary Tree Leetcode Solution 219 417 Subset sum problem 219 418 Print all subarrays with 0 sum 219 419 Length of the largest subarray with contiguous elements 218 420 Sort a stack using recursion 218 421 Happy Number Leetcode Solution 218 422 Best Time to Buy and Sell Stock  II Leetcode Solution 218 423 Matrix Diagonal Sum Leetcode Solution 218 424 Average Salary Excluding the Minimum and Maximum Salary Leetcode Solution 218 425 Sort Integers by The Number of 1 Bit Leetcode Solution 217 426 Print All Distinct Elements of a Given Integer Array 217 427 Count Substrings with equal number of 0s, 1s and 2s 217 428 Unique Paths Leetcode Solution 217 429 Subarray Sum Equals k 217 430 Coin Change 2 Leetcode Solution 217 431 Search in Rotated Sorted Array Leetcode Solution 216 432 Nth Catalan Number 216 433 Prim’s Algorithm 216 434 Find Winner on a Tic Tac Toe Game Leetcode Solution 216 435 Capacity To Ship Packages Within D Days Leetcode Solution 216 436 Remove Minimum Number of Elements Such That no Common Element Exist in both Array 216 437 Decode String 215 438 Fizz Buzz 215 439 Reverse Integer 214 440 How Many Numbers Are Smaller Than the Current Number Leetcode Solution 214 441 LRU Cache Implementation 214 442 Subarray Sum Equals K LeetCode Solution 214 443 Find Minimum In Rotated Sorted Array 214 444 Subarrays with distinct elements 213 445 Check If N and Its Double Exist Leetcode Solution 213 446 Fibonacci Number LeetCode Solution 213 447 Find elements which are present in first array and not in second 212 448 Max Consecutive Ones Leetcode Solution 212 449 Monotonic Array LeetCode Solution 212 450 Trapping Rain Water Leetcode Solution 212 451 Count pairs from two linked lists whose sum is equal to a given value 212 452 Find The Duplicate Number 212 453 Find all pairs [a, b] in an array such that a % b = k 212 454 Best Time to Buy and Sell Stock III Leetcode Solution 212 455 Edit Distance 211 456 Integer to English words 211 457 Reverse a String 211 458 Reverse a Stack Using Recursion 211 459 Count and Say 211 460 Find any one of the multiple repeating elements in read only array 210 461 Find distinct elements common to all rows of a matrix 210 462 Text Justification LeetCode Solution 210 463 Kth largest element in an Array Leetcode Solutions 210 464 Reverse a linked list 210 465 Remove Duplicates from Sorted Array Leetcode Solution 210 466 Target Sum 210 467 Reverse Vowels of a String Leetcode Solution 209 468 Floyd Warshall Algorithm 209 469 Sum of Subarray Ranges Leetcode Solution 209 470 Find Common Characters Leetcode Solution 209 471 Longest Common Prefix using Trie 209 472 Subtract the Product and Sum of Digits of an Integer Leetcode Solution 209 473 Sorting a Queue without Extra Space 208 474 Generate a String With Characters That Have Odd Counts Leetcode Solution 208 475 Find the Difference Leetcode Solution 208 476 Prefix to Postfix Conversion 208 477 Word Ladder LeetCode Solution 207 478 Iterative Inorder Traversal of a Binary Tree 207 479 Longest subarray not having more than K distinct elements 207 480 Delete a Node from linked list without head pointer 207 481 Valid Parenthesis String 207 482 Find four elements that sum to a given value [Hashmap] 207 483 The K Weakest Rows in a Matrix Leetcode Solution 207 484 Design Parking System Leetcode Solution 207 485 Merge Two Sorted Linked Lists 207 486 Priority Queue Using Singly Linked List 207 487 MiniMax Algorithm 207 488 Iterative Tower of Hanoi 207 489 Pair with given product 207 490 Multiply Strings Leetcode Solution 206 491 Shortest Palindrome 206 492 Shuffle String Leetcode Solution 206 493 Find missing elements of a range 206 494 Shuffle the Array Leetcode Solution 206 495 Find Index of Closing Bracket for a Given Opening Bracket in an Expression 206 496 Degree of an array 206 497 Check if a given array contains duplicate elements within k distance from each other 206 498 Top View of Binary Tree 205 499 Reverse Words in a String III LeetCode Solution 205 500 Flood Fill LeetCode 205 501 Excel Sheet Column Number Leetcode Solution 205 502 Balanced Binary Tree Leetcode Solution 205 503 Substring With Concatenation Of All Words 204 504 Longest Common Subsequence 204 505 Find the Duplicate Element 204 506 Largest Sum Contiguous Subarray 204 507 K-th Distinct Element in an Array 204 508 Rearrange a binary string as alternate x and y occurrences 204 509 Find subarray with given sum [Handles Negative Numbers] 204 510 Longest Common Prefix using Sorting 203 511 Slowest Key Leetcode Solution 203 512 The Stock Span Problem 203 513 Number of Steps to Reduce a Number to Zero Leetcode Solution 203 514 Next Greater Frequency Element 203 515 Kids With the Greatest Number of Candies Leetcode Solution 203 516 Valid Sudoku 203 517 Recursion 202 518 Move Zeroes LeetCode Solution 202 519 Concatenation of Array LeetCode Solution 202 520 Kth Largest Element in a Stream Leetcode Solution 202 521 Next Greater Element I Leetcode Solution 202 522 Implement a stack using single queue 202 523 Jump Game Leetcode Solution 202 524 Postfix to Prefix Conversion 202 525 Count number of triplets with product equal to given number 202 526 Priority Queue in C++ 202 527 Check for Balanced Parentheses in an Expression 202 528 Max Area of Island 201 529 Arrange given numbers to form the biggest number 201 530 Minimum Moves to Equal Array Elements Leetcode Solution 201 531 Find First and Last Position of Element in Sorted Array Leetcode Solution 201 532 Implement Stack using Queues 201 533 Container with Most Water 201 534 Find N Unique Integers Sum up to Zero Leetcode Solution 200 535 Peak Index in a Mountain Array 200 536 Gold Mine Problem 200 537 Count and Say Leetcode Solution 200 538 Convert a normal BST to Balanced BST 200 539 Sum of Left Leaves Leetcode Solutions 200 540 Intersection of Two Arrays 200 541 Merge Overlapping Intervals 200 542 Convert array into Zig-Zag fashion 200 543 Shuffle an Array 200 544 Smallest Subarray With all Occurrences of a Most Frequent Element 200 545 Minimum Knight Moves LeetCode Solution 200 546 Zigzag Conversion LeetCode Solution 199 547 Minimum Delete Operations to make all Elements of Array Same 199 548 Group Multiple Occurrence of Array Elements Ordered by first Occurrence 199 549 Count the number of nodes at given level in a tree using BFS 198 550 Valid Anagrams 198 551 Find Sum of all unique sub-array sum for a given array 198 552 How to check if two given sets are disjoint? 198 553 Change the Array into Permutation of Numbers From 1 to N 198 554 Isomorphic Strings Leetcode Solution 198 555 Minimum Bracket Reversals 198 556 Delete Node in a Linked List Leetcode Solution 198 557 Contiguous Array Leetcode 198 558 Excel Sheet Column Title Leetcode Solution 197 559 Linked List Cycle II LeetCode Solution 197 560 Mobile Numeric Keypad Problem 197 561 Hamming Distance 197 562 Largest Perimeter Triangle Leetcode Solution 196 563 Maximum path sum in a triangle 196 564 Maximum sum rectangle in a 2D matrix 196 565 Length of Last Word Leetcode Solution 196 566 Is Subsequence Leetcode Solution 196 567 Distribute Candies to People Leetcode Solution 196 568 Last Stone Weight 196 569 Number of Provinces Leetcode Solution 196 570 Find if an Expression has Duplicate Parenthesis or Not 195 571 Relative Sort Array Leetcode Solution 195 572 Koko Eating Bananas Leetcode Solution 195 573 Best Time to Buy and Sell Stock 195 574 Maximum difference between first and last indexes of an element in array 195 575 Implementation of Deque using circular array 195 576 N-th Tribonacci Number Leetcode Solution 195 577 3Sum Closest LeetCode Solution 195 578 Minimum number of subsets with distinct elements 195 579 Check if a queue can be sorted into another queue using a stack 194 580 Smallest Good Base 194 581 Minimum Operations to convert X to Y 194 582 Build Array From Permutation Leetcode Solution 194 583 Find Words That Can Be Formed by Characters Leetcode Solution 194 584 Longest Increasing Subsequence 194 585 Summary Ranges Leetcode Solution 193 586 Assign Cookies Leetcode Solution 193 587 LRU Cache LeetCode Solution 193 588 Maximum Distance in Array 193 589 Combinations Leetcode Solution 193 590 Island Perimeter Leetcode Solution 193 591 Integer to Roman 193 592 Minimum Cost to Hire K Workers 193 593 Remove Linked List Elements Leetcode Solution 192 594 Bubble sort using two Stacks 192 595 First negative integer in every window of size k 192 596 Decode Ways 192 597 The Knapsack Problem 192 598 Jewels and Stones Leetcode Solution 192 599 Iterative Method to find Height of Binary Tree 191 600 Sort Characters By Frequency LeetCode Solution 191 601 Maximum Number of Occurrences of a Substring Leetcode Solution 191 602 Rotate List Leetcode Solution 191 603 Rotate Image LeetCode Solution 191 604 Sieve of Eratosthenes 191 605 01 Matrix LeetCode Solution 191 606 Shortest Path in a Grid with Obstacles Elimination LeetCode Solution 190 607 Trapping Rain Water LeetCode Solution 190 608 Find the smallest positive integer value that cannot be represented as sum of any subset of a given array 190 609 Count all subsequences having product less than K 190 610 Reverse a stack without using extra space in O[n] 190 611 Unique Binary Search Trees 190 612 Word Pattern 190 613 Convert Sorted Array to Binary Search Tree Leetcode Solution 190 614 Minimum number of distinct elements after removing m items 190 615 Insert Interval Leetcode Solution 189 616 Remove All Occurrences of a Substring LeetCode Solution 189 617 Delete consecutive same words in a sequence 189 618 Non-overlapping sum of two sets 189 619 How to Create Mergable Stack? 188 620 Find minimum difference between any two elements 188 621 Minimum insertions to form a palindrome with permutations allowed 188 622 Frog Jump Leetcode Solution 188 623 Permutation in String Leetcode Solution 188 624 Maximum Number of Chocolates to be Distributed Equally Among k Students 188 625 GCD Of Two Numbers 188 626 Tracking current Maximum Element in a Stack 188 627 Same Tree LeetCode Solution 188 628 XOR Operation in an Array Leetcode Solution 188 629 Sum of f[a[i], a[j]] over all pairs in an array of n integers 187 630 Distance Between Bus Stops Leetcode Solution 187 631 Applications of Breadth First Search and Depth First Search 187 632 Isomorphic Strings 187 633 Find the Duplicate Number LeetCode Solution 187 634 Convert an array to reduced form 186 635 Optimal Account Balancing LeetCode Solution 186 636 Defanging an IP Address Leetcode Solution 186 637 Form minimum number from given sequence 186 638 Stone Game LeetCode 186 639 Find Largest d in Array such that a + b + c = d 186 640 K Empty Slots 185 641 Minimum Number of Steps to Make Two Strings Anagram Leetcode Solutions 185 642 Employee Free Time LeetCode Solution 185 643 First Unique Character in a String LeetCode Solution 185 644 Printing brackets in Matrix Chain Multiplication Problem 185 645 House Robber 185 646 Merge Two Balanced Binary Search Trees 185 647 Check If It Is a Straight Line Leetcode Solution 185 648 License Key Formatting Leetcode Solution 185 649 Reorganize String 185 650 Painting Fence Algorithm 185 651 Find pairs with given sum such that elements of pair are in different rows 185 652 Best Time to Buy and Sell Stock LeetCode Solution 184 653 Word Wrap Problem 184 654 Sort Array By Parity LeetCode Solution 184 655 K Empty Slots LeetCode 184 656 Letter Combinations of a Phone Number 184 657 Coin Change Problem 184 658 Replace Elements with Greatest Element on Right Side Leetcode Solution 184 659 Longest Substring with At Least K Repeating Characters LeetCode Solution 184 660 Segregate 0s and 1s in an Array 184 661 Distance of nearest cell having 1 in a binary matrix 183 662 Longest Substring with At Most K Distinct Characters LeetCode Solution 183 663 Robot Room Cleaner Leetcode Solution 183 664 Kth Missing Positive Number Leetcode Solution 183 665 Longest Increasing Path in a Matrix LeetCode Solution 183 666 Flipping an Image LeetCode Solution 183 667 Maximum Consecutive Numbers Present in an Array 183 668 Minimum Depth of Binary Tree Leetcode Solution 183 669 Strobogrammatic Number LeetCode Solution 183 670 Power of Four Leetcode Solution 183 671 Queries for counts of array elements with values in given range 182 672 Convert a Number to Hexadecimal Leetcode Solution 182 673 Find the node with minimum value in a Binary Search Tree 182 674 Wiggle Sort 182 675 Find Pair with Greatest Product in Array 182 676 Count Good Nodes in Binary Tree Leetcode Solution 182 677 Partition Labels LeetCode Solution 182 678 Maximum Product of Two Elements in an Array Leetcode Solution 181 679 Reducing Dishes LeetCode Solution 181 680 Reservoir Sampling 181 681 Find Maximum Level sum in Binary Tree 181 682 Find the Distance Value Between Two Arrays Leetcode Solution 181 683 Sum of All Odd Length Subarrays Leetcode Solution 181 684 Moving Average from Data Stream Leetcode Solution 181 685 Inorder Successor of a node in Binary Tree 181 686 Best Time to Buy and Sell Stock with Cooldown Leetcode Solution 181 687 Valid Palindrome II Leetcode Solution 181 688 Longest Span with same Sum in two Binary arrays 180 689 Find unique character in a string 180 690 Path With Maximum Minimum Value LeetCode Solution 180 691 Binary Tree Maximum Path Sum LeetCode Solution 180 692 Valid Palindrome 180 693 Find Leaves of Binary Tree LeetCode Solution 180 694 Dynamic Programming Basics 180 695 Partition Array Into Three Parts With Equal Sum Leetcode Solution 179 696 String Compression LeetCode Solution 179 697 To Lower Case Leetcode Solution 179 698 Numbers with prime frequencies greater than or equal to k 179 699 Increasing Decreasing String Leetcode Solution 179 700 Print the Fibonacci numbers in reverse order 179 701 Find the Smallest Divisor given a Threshold Leetcode Solution 179 702 Unique Paths II Leetcode Solution 179 703 Find whether an array is subset of another array 179 704 String to Integer [atoi] LeetCode Solution 179 705 Find the largest multiple of 3 178 706 Reverse Only Letters LeetCode Solution 178 707 Rearrange an array in order – smallest, largest, 2nd smallest, 2nd largest 178 708 Binary Tree Zigzag Level Order Traversal LeetCode Solution 178 709 BFS vs DFS for Binary Tree 178 710 Lucky Numbers in a Matrix Leetcode Solution 178 711 Remove Invalid Parentheses Leetcode Solution 178 712 Binary Tree zigzag level order Traversal 178 713 Delete Nth node from the end of the given linked list 178 714 Sort Array by Increasing Frequency Leetcode Solution 178 715 Subset Sum Leetcode 178 716 Number of Dice Rolls With Target Sum LeetCode Solution 178 717 Reversing a Queue using Recursion 178 718 Populating Next Right Pointers in Each Node 178 719 Recover Binary Search Tree 178 720 Check If Two String Arrays are Equivalent Leetcode Solution 178 721 Maximum Number of Coins You Can Get Leetcode Solution 178 722 Factorial Trailing Zeroes Leetcode Solution 178 723 Count quadruples from four sorted arrays whose sum is equal to a given value x 178 724 Merge Two Binary Trees LeetCode Solution 177 725 Snakes and Ladders LeetCode Solution 177 726 Edit Distance LeetCode Solution 177 727 Permutation Sequence LeetCode Solution 177 728 Remove brackets from an algebraic string containing + and – operators 177 729 Ugly Number Leetcode Solution 177 730 Valid Perfect Square Leetcode Solution 177 731 Find Maximum Depth of Nested Parenthesis in a String 177 732 Morris Traversal 176 733 Minimum Cost For Tickets Leetcode Solution 176 734 Stack Permutations [Check if an array is stack permutation of other] 176 735 k-th missing element in increasing sequence which is not present in a given sequence 176 736 Non-decreasing Array LeetCode Solution 176 737 Majority Element II Leetcode Solution 176 738 Largest subarray with equal number of 0s and 1s 176 739 Construct BST from given Preorder Traversal 176 740 Add and Search Word – Data structure design LeetCode 176 741 Tiling Problem 176 742 Generate all possible sorted arrays from alternate elements of two given sorted arrays 176 743 Bulb Switcher LeetCode Solution 176 744 Valid Number 175 745 Regular Expression Matching 175 746 Merge Sorted Array LeetCode Solution 175 747 Number of NGEs to the Right 175 748 Race Car LeetCode Solution 175 749 Perform String Shifts Leetcode 175 750 Restore IP Addresses Leetcode Solution 175 751 Binomial Coefficient 174 752 Best Meeting Point LeetCode Solution 174 753 Minimum Distance Between BST Nodes Leetcode Solution 174 754 Rank Transform of an Array Leetcode Solution 174 755 Print a Binary Tree in Vertical Order 174 756 String comparison containing wildcards 174 757 Check for Palindrome after every character replacement Query 174 758 Keyboard Row Leetcode Solution 174 759 Growable array based stack 174 760 Student Attendance Record I Leetcode Solution 174 761 Word Pattern LeetCode Solution 173 762 Priority Queue using doubly linked list 173 763 Find if Path Exists in Graph Leetcode Solution 173 764 Jump Game 173 765 Finding K closest element 173 766 Decompress Run-Length Encoded List Leetcode Solution 173 767 Maximum Product of Three Numbers LeetCode Solution 173 768 Maximum 69 Number Leetcode Solution 173 769 Check if Two Expressions With Brackets are Same 173 770 Minimum Height Trees 173 771 Evaluate Reverse Polish Notation LeetCode Solution 173 772 Maximum Length of a Concatenated String with Unique Characters Leetcode Solution 173 773 Maximum Depth of N-ary Tree Leetcode Solution 173 774 N-Queens LeetCode Solution 173 775 Largest Rectangle in Histogram LeetCode Solution 173 776 Elements to be added so that all elements of a range are present in array 173 777 Maximum Profit in Job Scheduling Leetcode Solution 173 778 Find Median from Data Stream LeetCode Solution 173 779 Sorted Linked List to Balanced BST 172 780 Number of Islands II LeetCode Solution 172 781 Nested List Weight Sum II LeetCode Solution 172 782 Program for Bridge and Torch problem 172 783 Minimize Maximum Pair Sum in Array LeetCode Solution 172 784 Minimum sum of multiplications of n numbers 172 785 Diagonal Traversal of Binary Tree 172 786 Kth ancestor of a node in binary tree 172 787 Merge K Sorted Linked Lists 172 788 Queue based approach for first non-repeating character in a stream 172 789 Base 7 Leetcode Solution 171 790 Total Numbers With no Repeated Digits in a Range 171 791 Search in a Binary Search Tree Leetcode Solution 171 792 Longest Subarray Having Count of 1s One More than Count of 0s 171 793 Hamming Distance Leetcode Solution 171 794 Check If Array Pairs Are Divisible by k LeetCode Solution 171 795 Linked List Cycle 171 796 Maximum Nesting Depth of the Parentheses Leetcode Solution 171 797 Symmetric Tree Leetcode Solution 171 798 Count items common to both the lists but with different prices 171 799 One Edit Distance LeetCode Solution 170 800 Invert Binary Tree LeetCode Solution 170 801 Largest rectangular sub-matrix whose sum is 0 170 802 Binary Search Tree Search and Insertion 170 803 Partition to K Equal Sum Subsets Leetcode Solution 170 804 Sort an array according to the order defined by another array 170 805 Balanced Expression with Replacement 170 806 Deletion in a Binary Tree 170 807 Final Prices With a Special Discount in a Shop Leetcode Solution 170 808 Find All Possible Recipes from Given Supplies LeetCode Solution 170 809 Form Minimum Number From Given Sequence 170 810 Find All Duplicates in an Array LeetCode Solution 170 811 Minimum time required to rot all oranges 170 812 Nearest Exit from Entrance in Maze LeetCode Solution 169 813 Maximum Difference Between Increasing Elements LeetCode Solution 169 814 Relative Ranks Leetcode Solution 169 815 A Space Optimized DP solution for 0-1 Knapsack Problem 169 816 Circular Queue 169 817 Remove Nth Node From End of List Leetcode Solution 169 818 Brick Wall LeetCode Solution 169 819 Reorder Data in Log Files LeetCode Solution 169 820 Special Array With X Elements Greater Than or Equal X Leetcode Solution 169 821 Minimum Sum Path in a Triangle 168 822 Check if a given array can represent Preorder Traversal of Binary Search Tree 168 823 Minimum Time Visiting All Points Leetcode Solution 168 824 Remove Duplicates from Sorted List II 168 825 Search a 2D Matrix II Leetcode Solution 168 826 Course Schedule II – LeetCode 168 827 Transpose Graph 168 828 Tree Traversal [Preorder, Inorder & Postorder] 168 829 Last Stone Weight II LeetCode Solution 168 830 Split a String in Balanced Strings Leetcode Solution 168 831 Given an Array of Pairs Find all Symmetric Pairs in it 168 832 Find Maximum Sum Possible Equal Sum of Three Stacks 168 833 Identify and Mark Unmatched Parenthesis in an Expression 168 834 Permutation Coefficient 168 835 Minimum Swaps to Make Strings Equal Leetcode Solution 168 836 LCS [Longest Common Subsequence] of three strings 168 837 Insert Delete GetRandom 168 838 Sort Array By Parity II Leetcode Solution 167 839 Minimum Number of Taps to Open to Water a Garden LeetCode Solution 167 840 Remove Duplicates from Sorted List LeetCode Solution 167 841 Iterative Preorder Traversal 167 842 Valid Parentheses Leetcode Solution 167 843 Partition List Leetcode Solution 167 844 Repeated Substring Pattern LeetCode Solution 167 845 Crawler Log Folder Leetcode Solution 167 846 Check if stack elements are pairwise consecutive 167 847 Alien Dictionary LeetCode Solution 167 848 Minimum Jumps to Reach Home LeetCode Solution 167 849 Sorted Array to Balanced BST 166 850 Minimum number of jumps to reach end 166 851 Spiral Matrix II Leetcode Solution 166 852 Brightest Position on Street LeetCode Solution 166 853 Clone Graph LeetCode Solution 166 854 Check if an Array is Stack Sortable 166 855 GCDs of given index ranges in an array 166 856 Minimum swaps to make sequences increasing 166 857 Interval Tree 166 858 Missing Element in Sorted Array LeetCode Solution 166 859 Number of Days Between Two Dates LeetCode Solution 166 860 Top K Frequent Words LeetCode Solution 166 861 Maximum Score After Splitting a String Leetcode Solution 166 862 Sort Colors 165 863 Maximum size subarray sum equals k 165 864 Matrix Chain Multiplication 165 865 Subset with sum divisible by m 165 866 Subarray Product Less Than K LeetCode Solution 165 867 Can Place Flowers LeetCode Solution 165 868 Find distance between two nodes of a Binary Tree 165 869 Number Complement Leetcode Solution 165 870 Find all permuted rows of a given row in a matrix 165 871 Get Maximum in Generated Array Leetcode Solution 165 872 Design Browser History LeetCode Solution 165 873 Subsequence of Size K With the Largest Even Sum LeetCode Solution 165 874 Find all triplets with zero sum 165 875 Guess Number Higher or Lower LeetCode Solution 165 876 A program to check if a binary tree is BST or not 165 877 Count ways to reach the nth stair using step 1, 2 or 3 165 878 Daily Temperatures Leetcode Solution 165 879 Distinct adjacent elements in an array 165 880 Design a Stack With Increment Operation Leetcode Solution 164 881 Check whether a given Binary Tree is Complete or not 164 882 An Interesting Method to generate Binary Numbers from 1 to n 164 883 Iterative Postorder Traversal Using Two Stacks 164 884 Level order Traversal in Spiral Form 164 885 Count Distinct Elements in Every Window of Size K 164 886 Make Two Arrays Equal by Reversing Sub-arrays Leetcode Solution 164 887 Range sum queries without updates 164 888 Convert BST to Min Heap 164 889 Find the Only Repetitive Element Between 1 to N-1 164 890 Split Array Into Consecutive Subsequences 164 891 Lemonade Change Leetcode Solution 164 892 Water Bottles Leetcode Solution 164 893 Union and Intersection of two Linked Lists 164 894 Path with maximum average value 163 895 Range LCM Queries 163 896 Infix to Postfix 163 897 Rearrange Array such that arr[i] >= arr[j] if i is even and arr[i]

Bài mới nhất

Chủ Đề