Ice Cream Parlor

  • + 0 comments

    C#

        public static List<int> icecreamParlor(int m, List<int> arr)
        {   
            List<int> returnA = new List<int>();
    
            for (int i = 0; i < arr.Count; i++){
                
                for (int j = 0; j < arr.Count; j++){
                    
                    if (arr[i] + arr[j] == m && i != j){
                        returnA = [(i + 1), (j + 1)];
                        returnA.Sort();
                        break;
                    }
                }
            
            }
            
            return returnA;
            
        }