Can we do this question using priority queue and custom sorting technique?
@kevintamakuwalaАй бұрын
@@SOUMYABANERJEE-hq9wl It would again take O(N) (for generation of numbers) + O(NlogN) (for sorting / priority queue) ending up in TLE. As constraints are in power of 9, Lesser than logarithmic Complexities are preferred
@hrutubhatt4179Ай бұрын
Great explanation! 🙌🏻
@kevintamakuwalaАй бұрын
@@hrutubhatt4179 thank you so much 😊
@it077brijpatel2Ай бұрын
Excellent 😊
@kevintamakuwalaАй бұрын
@@it077brijpatel2 thank you so much 😊
@patelhitarth08Ай бұрын
Genuinely, a very good explanation it was 💯
@kevintamakuwalaАй бұрын
@@patelhitarth08 thank you so much 😊
@-Deependragharia2 ай бұрын
Great work ✨️✨️
@kevintamakuwalaАй бұрын
@@-Deependragharia thank you so much 😊
@mandarparekh89592 ай бұрын
great explained keep it up buddy....
@kevintamakuwala2 ай бұрын
Thanks bro 🙏
@uditmehta57192 ай бұрын
Nice explanation
@kevintamakuwalaАй бұрын
@@uditmehta5719 thank you so much 😊
@uditmehta57192 ай бұрын
Nice explanation
@kevintamakuwalaАй бұрын
@@uditmehta5719 thank you so much 😊
@striver_1082 ай бұрын
great
@kevintamakuwalaАй бұрын
@@striver_108 thank you so much 😊
@sahilsapariya59242 ай бұрын
Very good explaination of intuition! it helped a lot today! Thanks...
@kevintamakuwalaАй бұрын
@@sahilsapariya5924 thank you so much 😊
@it077brijpatel22 ай бұрын
Great explanation 👌
@kevintamakuwalaАй бұрын
@@it077brijpatel2 thank you so much 😊
@it077brijpatel22 ай бұрын
Great explanation 👌
@kevintamakuwalaАй бұрын
@@it077brijpatel2 thank you so much 😊
@uditmehta57192 ай бұрын
Nice explanation
@kevintamakuwalaАй бұрын
@@uditmehta5719 thank you so much 😊
@uditmehta57192 ай бұрын
Nice explanation
@kevintamakuwalaАй бұрын
@@uditmehta5719 thank you so much 😊
@yosansu6 ай бұрын
looks great! how are you handling concurrent submissions? are you spawning separate docker containers for each submission?
@kevintamakuwala6 ай бұрын
No, actually I am creating temporary files on EC2 on each submission request. Thereafter, I am compiling code with input{hash}.txt on my EC2 instance and then storing output in output.txt file and then returning output{hash}.txt content as response, if no compilation error. I am deleting the created files afterwards. In this way, I am handling concurrent request. Limitations in this approach may be: - On thousands of requests simultaneously, system may crash due to single instance and lesser RAM capacity. Is there any more efficient way of handling concurrent requests to serve the purpose?
@yosansu6 ай бұрын
@@kevintamakuwala Looks cool. I was wondering that the runtime for processing submissions would then depend on the number of concurrent users, right? In case I submit my problem during a contest, time limit might exceed if compared to the time if I submit when no one else is submitting 🤔
@kevintamakuwala6 ай бұрын
@@yosansu Exactly, it would depend on number of users indeed. I have thought of this problem earlier, but currently at this point of time, I am not concerned about TLE, MLE checks. Even O(N!) would pass the test cases. Maybe I can implement it as soon as I get to know about the feasible solutions. One possible solution could be creating threads and running a submission of a user on a single allotted thread. Any suggestions?
@we_r_sanatani_Hindu7 ай бұрын
Great. Can you please help me know where have you implemented the part that validates the code of user against the output required?
@kevintamakuwala6 ай бұрын
After compilation, I am getting the output of the submitted code submitted as my response, which I am matching against the expected output in CodeEditor component. If any one of the TC fails, I prompt WA msg to the user.