Connect a graph by M edges such that the graph does not contain any cycle and Bitwise AND of connected vertices is maximum

#include
using namespace std;
  

int maximumAND(int arr[], int n, int m)
{
    
    
    int tot = 1 > i) & 1) {
                
                if (count == 0) {
                    
                    andans = arr[i];
                }
                else {
                    
                    
                    andans = andans & arr[i];
                }
  
                
                
                count++;
            }
        }
  
        
        
        if (count == (m + 1)) {
            
            
            mx = max(mx, andans);
        }
    }
  
    
    
    return mx;
}
  

int main()
{
    int arr[] = { 1, 2, 3, 4 };
    int N = sizeof(arr) / sizeof(arr[0]);
    int M = 2;
  
    cout