Skip to content
the poor coder

Home / Topics / #leetcode

#leetcode

131 posts · page 3 of 7
2021

Leetcode - Defanging an IP Address Solution

Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every period "." with "[.]". Example 1: Example 2: Constraints: The given address is a valid IPv4 address…

leetcodestring1 min read
2021

Leetcode - Height Checker Solution

A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected…

leetcodearray1 min read
2021

Leetcode - Reverse Only Letters Solution

Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positions. Example 1: Example 2: Example 3: Note: S.length <= 100 33 <=…

leetcodestring1 min read
2021

Leetcode - Sort Array By Parity Solution

Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may return any answer array that satisfies this condition. Example 1: Note…

leetcodearray1 min read
2021

Leetcode - Find and Replace Pattern Solution

You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the…

leetcodestring1 min read
ESC