Author: Kavit

0

Add / Push Characters to string in Javascript

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” text_text_color=”#000000″ use_border_color=”off” border_color=”#ffffff” border_style=”solid”] var a  = ‘wxy’; a = a.concat(‘z’); console.log(a); // wxyz [/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

0

Generate all combinations of a string in javascript

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]   [/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

0

Print nodes at k level from the root in a binary tree

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”] Given a binary tree, level k, print all the nodes at level k. For example, 4, 7, 8 are at level 2.   1...

0

Count Negative Numbers in a Row And Column Wise Sorted Matrix [Amazon]

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” text_text_color=”#000000″ use_border_color=”off” border_color=”#ffffff” border_style=”solid”] The given Matrix satisfies the following properties : M [ i ] [ j ] ≤ M [ i ] [ j + 1...

0

currying : javascript interview question

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” text_text_color=”#000000″ use_border_color=”off” border_color=”#ffffff” border_style=”solid”] Currying is a useful technique, with which you can partially evaluate functions.   One of the most basic example of the currying is...

Netflix 0

flatten three level deep tree

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” saved_tabs=”all” background_layout=”light” text_orientation=”left” text_text_color=”#000000″ use_border_color=”off” border_color=”#ffffff” border_style=”solid” global_module=”1167″] In the previous examples, we saw how to filter two level deep trees with map, filter and concatAll. Let’s try three....

0

Find the first common ancestor of two nodes in a binary tree

Algorithm Create two arrays with in-order and post-order traversal for the given binary tree and call them in-order and post-order traversal respectively. Find the number of nodes in-between the given two nodes in the...

0

Distinct ways to reach the n’th stair

Problem: Given stair case with n stairs, count the number of ways in which you can climb the stairs. Each time you can either take 1 step or 2 steps. Solution: — Number of...

Show Buttons
Hide Buttons