Driver code
public static void main ( String [ ] args ) { String str = "1234" ; if ( topsyTurvy ( str . toCharArray ( ) ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }