why I am getting TLE in O(1) solution
Question Link : CodeChef: Practical coding for everyone
#define ull long long int
using namespace std;
I think there is problem in your logic you should think about it once again.
You can get help from there MULTHREE - Editorial
can you format your code ? consider using ``` before you start pasting your code, it will do the job
Check out as In every number formation ,either first 4 digits starting from either 2nd or 3rd digit (I didn’t remember exactly) of whole number , the pattern will be repetitive and hence if the number of digits doesn’t end up with a multiple of 4 , then checkout how many you can make (groups of 4 digit) and remaining digits will be first wanted digits from the 4 digits you formed/got while checking the sequence…and at last don’t forget to add first 2-3 digits after which sequence/repetitive is started,and then calculate total sum and check multiple of 3 .