Given a non-empty sequence of characters, return true if sequence is Binary, else return false
The task is to complete the method that takes a string as argument. We should not read any input from stdin/console. There are multiple test cases. For each test case, this method will be called individually.
Your function should return true str is binary, else false
1 <=T<= 50
1 <=Length of str<= 10000
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.