Microsoft Assignment
Microsoft Assignment
(p
(/) Explore(/explore/) Problems(/problemset/all/)
New
Interview
(/contest/)
Contest
🔈 LeetCode is(https://leetcode.com/jobs/)
Discuss(/discuss/)
hiring! Apply NOW.🔈
0connections-in-a-
Store
network/)
Microsoft
Problems Discuss
Notice
We've improved our algorithm that calculates company tags and their frequencies to be more accurate and current.
1239 Maximum Length of a Concatenated String with Unique Characters (/problems/maximum-length- 50.5% Medium
of-a-concatenated-string-with-unique-characters)
103 Binary Tree Zigzag Level Order Traversal (/problems/binary-tree-zigzag-level-order-traversal) 53.7% Medium
https://leetcode.com/company/microsoft/ 1/20
5/18/22, 6:05 PM Microsoft - LeetCode
1647 Minimum Deletions to Make Character Frequencies Unique (/problems/minimum-deletions-to- 56.4% Medium
make-character-frequencies-unique)
116 Populating Next Right Pointers in Each Node (/problems/populating-next-right-pointers-in-each- 57.3% Medium
node)
105 Construct Binary Tree from Preorder and Inorder Traversal (/problems/construct-binary-tree-from- 57.8% Medium
preorder-and-inorder-traversal)
https://leetcode.com/company/microsoft/ 2/20
5/18/22, 6:05 PM Microsoft - LeetCode
117 Populating Next Right Pointers in Each Node II (/problems/populating-next-right-pointers-in- 48.4% Medium
each-node-ii)
121 Best Time to Buy and Sell Stock (/problems/best-time-to-buy-and-sell-stock) 54.1% Easy
340 Longest Substring with At Most K Distinct Characters (/problems/longest-substring-with-at-most- 47.4% Medium
k-distinct-characters)
1576 Replace All ?'s to Avoid Consecutive Repeating Characters (/problems/replace-all-s-to-avoid- 49.7% Easy
consecutive-repeating-characters)
https://leetcode.com/company/microsoft/ 3/20
5/18/22, 6:05 PM Microsoft - LeetCode
426 Convert Binary Search Tree to Sorted Doubly Linked List (/problems/convert-binary-search-tree-to- 64.4% Medium
sorted-doubly-linked-list)
158 Read N Characters Given read4 II - Call Multiple Times (/problems/read-n-characters-given-read4- 40.9% Hard
ii-call-multiple-times)
708 Insert into a Sorted Circular Linked List (/problems/insert-into-a-sorted-circular-linked-list) 34.4% Medium
https://leetcode.com/company/microsoft/ 4/20
5/18/22, 6:05 PM Microsoft - LeetCode
235 Lowest Common Ancestor of a Binary Search Tree (/problems/lowest-common-ancestor-of-a- 57.2% Easy
binary-search-tree)
1275 Find Winner on a Tic Tac Toe Game (/problems/find-winner-on-a-tic-tac-toe-game) 54.7% Easy
1156 Swap For Longest Repeated Character Substring (/problems/swap-for-longest-repeated-character- 46.1% Medium
substring)
https://leetcode.com/company/microsoft/ 5/20
5/18/22, 6:05 PM Microsoft - LeetCode
106 Construct Binary Tree from Inorder and Postorder Traversal (/problems/construct-binary-tree- 55.5% Medium
from-inorder-and-postorder-traversal)
https://leetcode.com/company/microsoft/ 6/20
5/18/22, 6:05 PM Microsoft - LeetCode
109 Convert Sorted List to Binary Search Tree (/problems/convert-sorted-list-to-binary-search-tree) 55.7% Medium
123 Best Time to Buy and Sell Stock III (/problems/best-time-to-buy-and-sell-stock-iii) 43.3% Hard
1593 Split a String Into the Max Number of Unique Substrings (/problems/split-a-string-into-the-max- 54.5% Medium
number-of-unique-substrings)
https://leetcode.com/company/microsoft/ 7/20
5/18/22, 6:05 PM Microsoft - LeetCode
1190 Reverse Substrings Between Each Pair of Parentheses (/problems/reverse-substrings-between- 65.8% Medium
each-pair-of-parentheses)
159 Longest Substring with At Most Two Distinct Characters (/problems/longest-substring-with-at- 52.7% Medium
most-two-distinct-characters)
1639 Number of Ways to Form a Target String Given a Dictionary (/problems/number-of-ways-to-form- 42.5% Hard
a-target-string-given-a-dictionary)
1703 Minimum Adjacent Swaps for K Consecutive Ones (/problems/minimum-adjacent-swaps-for-k- 41.4% Hard
consecutive-ones)
122 Best Time to Buy and Sell Stock II (/problems/best-time-to-buy-and-sell-stock-ii) 62.1% Medium
108 Convert Sorted Array to Binary Search Tree (/problems/convert-sorted-array-to-binary-search-tree) 66.2% Easy
1650 Lowest Common Ancestor of a Binary Tree III (/problems/lowest-common-ancestor-of-a-binary- 77.4% Medium
tree-iii)
https://leetcode.com/company/microsoft/ 8/20
5/18/22, 6:05 PM Microsoft - LeetCode
1466 Reorder Routes to Make All Paths Lead to the City Zero (/problems/reorder-routes-to-make-all- 61.0% Medium
paths-lead-to-the-city-zero)
34 Find First and Last Position of Element in Sorted Array (/problems/find-first-and-last-position-of- 40.1% Medium
element-in-sorted-array)
395 Longest Substring with At Least K Repeating Characters (/problems/longest-substring-with-at- 44.6% Medium
least-k-repeating-characters)
1359 Count All Valid Pickup and Delivery Options (/problems/count-all-valid-pickup-and-delivery- 63.3% Hard
options)
632 Smallest Range Covering Elements from K Lists (/problems/smallest-range-covering-elements- 58.7% Hard
from-k-lists)
1353 Maximum Number of Events That Can Be Attended (/problems/maximum-number-of-events-that- 33.4% Medium
can-be-attended)
https://leetcode.com/company/microsoft/ 9/20
5/18/22, 6:05 PM Microsoft - LeetCode
1008 Construct Binary Search Tree from Preorder Traversal (/problems/construct-binary-search-tree- 80.3% Medium
from-preorder-traversal)
1222 Queens That Can Attack the King (/problems/queens-that-can-attack-the-king) 71.2% Medium
1836 Remove Duplicates From an Unsorted Linked List (/problems/remove-duplicates-from-an- 69.6% Medium
unsorted-linked-list)
1404 Number of Steps to Reduce a Number in Binary Representation to One (/problems/number-of- 50.9% Medium
steps-to-reduce-a-number-in-binary-representation-to-one)
1155 Number of Dice Rolls With Target Sum (/problems/number-of-dice-rolls-with-target-sum) 47.8% Medium
1312 Minimum Insertion Steps to Make a String Palindrome (/problems/minimum-insertion-steps-to- 63.8% Hard
make-a-string-palindrome)
https://leetcode.com/company/microsoft/ 10/20
5/18/22, 6:05 PM Microsoft - LeetCode
1775 Equal Sum Arrays With Minimum Number of Operations (/problems/equal-sum-arrays-with- 51.6% Medium
minimum-number-of-operations)
211 Design Add and Search Words Data Structure (/problems/design-add-and-search-words-data- 43.9% Medium
structure)
1277 Count Square Submatrices with All Ones (/problems/count-square-submatrices-with-all-ones) 74.2% Medium
https://leetcode.com/company/microsoft/ 11/20
5/18/22, 6:05 PM Microsoft - LeetCode
1884 Egg Drop With 2 Eggs and N Floors (/problems/egg-drop-with-2-eggs-and-n-floors) 69.9% Medium
https://leetcode.com/company/microsoft/ 12/20
5/18/22, 6:05 PM Microsoft - LeetCode
1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target (/problems/maximum- 46.5% Medium
number-of-non-overlapping-subarrays-with-sum-equals-target)
1293 Shortest Path in a Grid with Obstacles Elimination (/problems/shortest-path-in-a-grid-with- 43.5% Hard
obstacles-elimination)
https://leetcode.com/company/microsoft/ 13/20
5/18/22, 6:05 PM Microsoft - LeetCode
1986 Minimum Number of Work Sessions to Finish the Tasks (/problems/minimum-number-of-work- 31.9% Medium
sessions-to-finish-the-tasks)
1474 Delete N Nodes After M Nodes of a Linked List (/problems/delete-n-nodes-after-m-nodes-of-a- 73.5% Easy
linked-list)
https://leetcode.com/company/microsoft/ 14/20
5/18/22, 6:05 PM Microsoft - LeetCode
1347 Minimum Number of Steps to Make Two Strings Anagram (/problems/minimum-number-of-steps- 76.4% Medium
to-make-two-strings-anagram)
1326 Minimum Number of Taps to Open to Water a Garden (/problems/minimum-number-of-taps-to- 48.0% Hard
open-to-water-a-garden)
1723 Find Minimum Time to Finish All Jobs (/problems/find-minimum-time-to-finish-all-jobs) 43.0% Hard
1963 Minimum Number of Swaps to Make the String Balanced (/problems/minimum-number-of-swaps- 67.6% Medium
to-make-the-string-balanced)
https://leetcode.com/company/microsoft/ 15/20
5/18/22, 6:05 PM Microsoft - LeetCode
1374 Generate a String With Characters That Have Odd Counts (/problems/generate-a-string-with- 77.4% Easy
characters-that-have-odd-counts)
1743 Restore the Array From Adjacent Pairs (/problems/restore-the-array-from-adjacent-pairs) 68.3% Medium
https://leetcode.com/company/microsoft/ 16/20
5/18/22, 6:05 PM Microsoft - LeetCode
2259 Remove Digit From Number to Maximize Result (/problems/remove-digit-from-number-to- 46.2% Easy
maximize-result)
828 Count Unique Characters of All Substrings of a Given String (/problems/count-unique-characters- 50.0% Hard
of-all-substrings-of-a-given-string)
1567 Maximum Length of Subarray With Positive Product (/problems/maximum-length-of-subarray- 43.1% Medium
with-positive-product)
1477 Find Two Non-overlapping Sub-arrays Each With Target Sum (/problems/find-two-non- 36.8% Medium
overlapping-sub-arrays-each-with-target-sum)
1358 Number of Substrings Containing All Three Characters (/problems/number-of-substrings- 62.1% Medium
containing-all-three-characters)
https://leetcode.com/company/microsoft/ 17/20
5/18/22, 6:05 PM Microsoft - LeetCode
1941 Check if All Characters Have Equal Number of Occurrences (/problems/check-if-all-characters- 77.1% Easy
have-equal-number-of-occurrences)
1509 Minimum Difference Between Largest and Smallest Value in Three Moves (/problems/minimum- 55.3% Medium
difference-between-largest-and-smallest-value-in-three-moves)
2096 Step-By-Step Directions From a Binary Tree Node to Another (/problems/step-by-step-directions- 48.6% Medium
from-a-binary-tree-node-to-another)
2007 Find Original Array From Doubled Array (/problems/find-original-array-from-doubled-array) 38.1% Medium
https://leetcode.com/company/microsoft/ 18/20
5/18/22, 6:05 PM Microsoft - LeetCode
1290 Convert Binary Number in a Linked List to Integer (/problems/convert-binary-number-in-a-linked- 82.6% Easy
list-to-integer)
1983 Widest Pair of Indices With Equal Range Sum (/problems/widest-pair-of-indices-with-equal-range- 54.2% Medium
sum)
1013 Partition Array Into Three Parts With Equal Sum (/problems/partition-array-into-three-parts-with- 44.4% Easy
equal-sum)
1198 Find Smallest Common Element in All Rows (/problems/find-smallest-common-element-in-all- 76.0% Medium
rows)
1285 Find the Start and End Number of Continuous Ranges (/problems/find-the-start-and-end-number- 88.2% Medium
of-continuous-ranges)
1371 Find the Longest Substring Containing Vowels in Even Counts (/problems/find-the-longest- 62.6% Medium
substring-containing-vowels-in-even-counts)
1369 Get the Second Most Recent Activity (/problems/get-the-second-most-recent-activity) 69.0% Hard
1415 The k-th Lexicographical String of All Happy Strings of Length n (/problems/the-k-th- 71.4% Medium
lexicographical-string-of-all-happy-strings-of-length-n)
1637 Widest Vertical Area Between Two Points Containing No Points (/problems/widest-vertical-area- 84.0% Medium
between-two-points-containing-no-points)
1638 Count Substrings That Differ by One Character (/problems/count-substrings-that-differ-by-one- 72.0% Medium
character)
1671 Minimum Number of Removals to Make Mountain Array (/problems/minimum-number-of- 43.0% Hard
removals-to-make-mountain-array)
1802 Maximum Value at a Given Index in a Bounded Array (/problems/maximum-value-at-a-given- 30.6% Medium
index-in-a-bounded-array)
1887 Reduction Operations to Make the Array Elements Equal (/problems/reduction-operations-to- 61.7% Medium
make-the-array-elements-equal)
1904 The Number of Full Rounds You Have Played (/problems/the-number-of-full-rounds-you-have- 46.8% Medium
played)
https://leetcode.com/company/microsoft/ 19/20
5/18/22, 6:05 PM Microsoft - LeetCode
2052 Minimum Cost to Separate Sentence Into Rows (/problems/minimum-cost-to-separate-sentence- 52.2% Medium
into-rows)
2098 Subsequence of Size K With the Largest Even Sum (/problems/subsequence-of-size-k-with-the- 38.9% Medium
largest-even-sum)
2124 Check if All A's Appears Before All B's (/problems/check-if-all-as-appears-before-all-bs) 72.5% Easy
2107 Number of Unique Flavors After Sharing K Candies (/problems/number-of-unique-flavors-after- 57.7% Medium
sharing-k-candies)
2246 Longest Path With Different Adjacent Characters (/problems/longest-path-with-different-adjacent- 43.4% Hard
characters)
Help Center (/support) Jobs (/jobs) Bug Bounty (/bugbounty) Online Interview (/interview/) Students (/student) Terms (/terms) Privacy Policy (/privacy)
https://leetcode.com/company/microsoft/ 20/20