// Method1()- recursive solution(Top- down approach)
// time complexity - O(2^(m+n))
// space complexity - O(m+n)…


public static ListNode merge(ListNode left, ListNode right) {
if (left ==…


public class SingletonDemo {

private static SingletonDemo singleton = null;


private SingletonDemo() {
System.out.println("singleton created");
}

public static SingletonDemo getInstance() {
if (singleton == null) {
singleton = new SingletonDemo();
}
return singleton;
}
}


Maor Rocky

Hi i'm Maor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store