class LCA { public: int getLCA(int a, int b) { // write code here if(a>b) return getLCA(b, a); if(a==b) return a; if(b/2 > a) return getLCA(a, b/2); if(b/2 < a) return getLCA(a/2, b/2); return a; } };