Skip to content

Instantly share code, notes, and snippets.

@h-hub
Created September 17, 2023 06:52
Show Gist options
  • Save h-hub/7cb524f1c6035bf8758f5a511216663c to your computer and use it in GitHub Desktop.
Save h-hub/7cb524f1c6035bf8758f5a511216663c to your computer and use it in GitHub Desktop.

Revisions

  1. h-hub created this gist Sep 17, 2023.
    11 changes: 11 additions & 0 deletions isElementExistUgly.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    //Please do not use this
    static boolean isElementExistUgly(int[] ints, int b){
    try{
    int i=0;
    while (true){
    if(ints[i++]==b) return true;
    }
    } catch(ArrayIndexOutOfBoundsException ex){
    return false;
    }
    }