title: Program Find String Start End Geeks
signature: function program_find_string_start_end_geeks(str, corner)
test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(str, corner, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(str, corner) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver("geeksmanishgeeks", "geeks", true)
      print(string.format("TEST-0...%s",result))
  
      result = driver("shreyadhatwalia", "abc", false)
      print(string.format("TEST-1...%s",result))
  
      result = driver("10000100", "100", true)
      print(string.format("TEST-2...%s",result))
  
      result = driver("abaa", "a", true)
      print(string.format("TEST-3...%s",result))
  
      result = driver("30645530", "30", true)
      print(string.format("TEST-4...%s",result))
  
      result = driver("0000011011001", "001", false)
      print(string.format("TEST-5...%s",result))
  
      result = driver("dkqEd", "d", true)
      print(string.format("TEST-6...%s",result))
  
      result = driver("48694119324654", "654", false)
      print(string.format("TEST-7...%s",result))
  
      result = driver("1101010010", "11", false)
      print(string.format("TEST-8...%s",result))
  
      result = driver("Ks", "KsFLmngGGOmHKs", false)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
source_py: def program_find_string_start_end_geeks(str, corner):
      n = len(str)
      cl = len(corner)
      if (n < cl):
          return False
      return ((str[:cl] == corner) and (str[(n - cl):] == corner))
source_cpp: bool program_find_string_start_end_geeks(string str, string corner) {
    int n = str . length ( );
    int cl = corner . length ( );
    if ( n < cl ) return false;
    return ( str . substr ( 0, cl ) . compare ( corner ) == 0 && str . substr ( n - cl, cl ) . compare ( corner ) == 0 );
  }