Tag: Javascript coding exercise
A complete binary tree is a binary tree that each level except possibiliy the last level, is completed filled. Suppose you are giving a binary tree represented as an …
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, …
We have an array A of integers, and an array queries of queries. For the i-th query val = queries, index = queries, we add val to A. Then, …
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = , nums2 = Output: Example 2: Input: nums1 = , nums2 = Output: Note: …
In Javascript, given object var x = {a: {b: {c: “value”} } }, we can retrieve/access the field by x.a.b.c However, if a field doesn’t exist, exception will be …