title: Possible Form Triangle Array Values
signature: bool possibleFormTriangleArrayValues(vector<int> arr, int n) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual == expected;
  }
  
  string driver(vector<int> arr, int n, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver({2, 6, 8, 10, 14, 15, 16, 19, 21, 26, 26, 26, 28, 29, 30, 33, 33, 35, 36, 36, 41, 44, 45, 45, 45, 49, 51, 54, 57, 59, 61, 64, 68, 70, 70, 72, 73, 74, 76, 78, 87, 89, 89, 91, 92, 93, 94, 95, 97}, 25, true); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver({-96, -94, -90, -86, -78, -78, -74, -72, -64, -64, -58, -56, -50, -46, -44, -36, -26, -14, -12, -10, -4, 4, 10, 16, 18, 22, 30, 32, 38, 46, 46, 50, 54, 56, 72, 74, 82, 86, 86, 88, 90, 96}, 23, false); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 10, false); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver({24, 24, 41, 80, 90, 95}, 4, true); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver({-90, -88, -84, -82, -82, -80, -70, -66, -62, -60, -60, -48, -46, -44, -42, -20, -16, -4, 18, 26, 28, 32, 36, 46, 60, 62, 68, 72, 78, 98}, 21, true); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 25, true); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver({3, 9, 14, 16, 16, 26, 30, 31, 32, 37, 42, 42, 43, 49, 51, 56, 64, 69, 76, 77, 77, 79, 85, 88, 89, 91, 94, 95}, 19, true); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver({-90, -84, -74, -68, -66, -60, -60, -60, -58, -52, -50, -42, -38, -34, -30, 6, 30, 42, 60, 80, 94, 98}, 11, false); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, 18, true); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver({1, 3, 5, 8, 13, 15, 16, 22, 24, 26, 30, 31, 31, 33, 34, 39, 39, 40, 46, 49, 50, 51, 52, 59, 66, 69, 77, 80, 88, 90}, 23, true); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def possible_form_triangle_array_values(arr, N):
      if (N < 3):
          return False
      arr.sort()
      for i in range((N - 2)):
          if ((arr[i] + arr[(i + 1)]) > arr[(i + 2)]):
              return True
source_cpp: bool possible_form_triangle_array_values(vector<int> arr, int N) {
    if ( N < 3 ) return false;
    sort(arr.begin(), arr.end());
    for ( int i = 0;
    i < N - 2;
    i ++ ) if ( arr [ i ] + arr [ i + 1 ] > arr [ i + 2 ] ) return true;
  }