nikunjsoni

459

Jun 26th, 2021
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Solution {
  2. public:
  3.     bool repeatedSubstringPattern(string s) {
  4.         int pos = (s+s).find(s, 1);
  5.         return (pos >= 0 && pos < s.size());
  6.     }
  7. };
RAW Paste Data