How to take Input in TCS Coding Exam ? | Tips & Resources for practice | PYTHON | C++ | JAVA

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 78

  • @PrimeCoding19
    @PrimeCoding19  5 місяців тому +2

    Hello everyone, I hope your preparations are going well. If you have any friends who have given TCS NQT in 30th April shift then please let me know about the question asked.
    Thank you.

  • @ayushkumar83998
    @ayushkumar83998 3 місяці тому +16

    Thanks bro today was my nqt test and I got all my test cases passed because of you.

  • @Pizzza_Mania
    @Pizzza_Mania 5 місяців тому +2

    I am following ur content from past 1 week u r doing great job
    U r the only one who is explaining in python all other youtube channels are explaining in java
    Thank you so much
    I have some doubts
    Many people are saying
    Arr = list(map(int,s.split())) not working
    Next doubt is what to do if we don't know how many inputs they are giving
    Like this
    1
    2
    3
    4
    4
    ....
    If they give n number of input in space separated we can take it as string they we can modify but what if they give input line by line and didn't mention number of input what to do

    • @Pizzza_Mania
      @Pizzza_Mania 5 місяців тому +1

      Another doubt is in tcs compiler we can't see the print statement
      Do you have any idea how to see our output in the compiler
      Because one of my frd had tcs exm on 29th april he was unable to see the print statement he can only see number of test cases passed not the actual output of his code
      Pls give solution to this

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      Thanks for commenting, see if this is an array question, it will be given space separated or like a list. It will be easy for you to take its input. And I have given many templates to take input and make changes as per your requirement and you are ready to go.
      I saw many comments regarding the split.
      If you are not able to take input then watch the 4 point of the video) tips to overcome input error. Try the tip I included in this video.
      You will ace the coding around.

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      @@Pizzza_Mania I guess that's one way to look at it. Because some of my friends told that they were able to see the error and print the details.

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      One advice from my side Try as much as you can Because it took me hours to create these templates and all the possible cases I have tried to cover. So do try to it out and let me know the feedback.
      All the best buddy!

  • @a.smedia6231
    @a.smedia6231 21 день тому +3

    Sir can we use ? Or we have to use

  • @35_harshitnegi47
    @35_harshitnegi47 5 місяців тому +1

    GREAT JOB

  • @Pizzza_Mania
    @Pizzza_Mania 5 місяців тому +2

    can you pls make a dedicated video how to use try catch method in python for compiler issue

    • @Pizzza_Mania
      @Pizzza_Mania 5 місяців тому

      and what it will print by the error how and what we can find

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      You can find the try catch program in the Python template input_without_size function. In this, if the data type is changed then it will generate error. Try it yourself and let me know your doubts!

  • @adarshsrivastava3657
    @adarshsrivastava3657 5 місяців тому +2

    #include
    #include
    #include
    #include
    using namespace std;
    vector stringToArray(const string& input) {
    vector result;
    istringstream iss(input);
    int num;
    while (iss >> num) {
    result.push_back(num);
    }
    return result;
    }
    int main() {
    string input;
    getline(cin, input);
    vector ans = stringToArray(input);
    for (int i = 0; i < ans.size(); i++) {
    cout

  • @sarabindaroy3249
    @sarabindaroy3249 17 днів тому

    I have a question brother.If my code is compie successfully but when i submit the code.some testcase are failed.So in that time can i fixed the testcase and Submit the code again
    .

  • @utkarshkumar8613
    @utkarshkumar8613 5 місяців тому

    How will i know about the format of input? Like which case should we consider, pls explain, like is it space separated or with brackets

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      Good question Utkarsh,
      For separated space you can see in the given testcase and also check the output format.
      Please have a look at my video "How to take input in TCS NQT".

  • @soumyadipsaha8_1
    @soumyadipsaha8_1 5 місяців тому

    Integer.parseInt("1");
    Float.parseFloat("1.0")

  • @suryar-2239
    @suryar-2239 3 місяці тому

    Sir, I hope you are doing well. I have the TCS exam on July 17. I have a doubt about taking inputs in python.I know only the basics, and I have watched and learned all the questions from your videos. Is that enough?

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому +1

      Keep in mind everything I said in this input video. Yes 1 shot array string and all TCS NQT shift problems is enough

    • @suryar-2239
      @suryar-2239 3 місяці тому

      @@PrimeCoding19 thank you so much bro

    • @Goku-dk4mr
      @Goku-dk4mr 3 місяці тому

      you solved everything ?

    • @mdtabishhassan8527
      @mdtabishhassan8527 20 днів тому

      @@suryar-2239 how was your exam??

    • @suryar1650
      @suryar1650 19 днів тому

      @@mdtabishhassan8527 i got ninja bro complier is not working for many of the people

  • @manatv11
    @manatv11 5 місяців тому +1

    So many people who wrote tcs exam are saying that the split function is not working.... So without using split function how to take the inout please make an video or reply ne please

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      Many people are able to take input using the split function.
      The point is to identify in what format they are giving you input.
      If you need detailed explanation contact me on my Instagram, I would love to help you.

    • @manatv11
      @manatv11 5 місяців тому

      @@PrimeCoding19 so if the size is not given we can't use split function???

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      @@manatv11 We can use it easily in Python and for Java and c++ I have explained how you should do it.
      I think you should connect with me. I can help you understand better.

    • @manatv11
      @manatv11 5 місяців тому

      @@PrimeCoding19 if the size is not given then while loop must be used but can't take input in a single line as you have taken in the above scenarios,,right??

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      @@manatv11 Yes, and the while loop is iterating over the string (where we took input in one line) and only on numbers we are considering, not spaces or commas.

  • @m_rvtj
    @m_rvtj 5 місяців тому +1

    7:31 how can if you take each char from the get line the 29 is considered as two chars 2 and 9

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      Will take care of this in Python. In Java you need to use split using ','. the work will be done

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      Just try to run the given code. You will understand the work flow.

  • @surendharl2352
    @surendharl2352 5 місяців тому +1

    Why you take the input in form of string array for integer in java?

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      See if the array values are in integer format then you can take it easily. But as I said in tips on overcoming errors, if that's the case then you need to take the input as a string!
      At the beginning I said this video would cover all the worst case possibilities.
      I hope you have understood the topics.

    • @surendharl2352
      @surendharl2352 5 місяців тому

      @@PrimeCoding19 Got it ✨

  • @piyushpanchal046
    @piyushpanchal046 5 місяців тому +1

    How to take input in accenture
    please explain coding Q of accenture we have to write from zero or only function completions

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +1

      For Accenture also you need to write it from scratch!

    • @piyushpanchal046
      @piyushpanchal046 5 місяців тому +1

      @@PrimeCoding19 their compiler is better then tcs nqt

    • @piyushpanchal046
      @piyushpanchal046 5 місяців тому

      @@PrimeCoding19 can you explain coding interface of accenture

    • @piyushpanchal046
      @piyushpanchal046 5 місяців тому

      @@PrimeCoding19 can you explain the coding interface of accenture.
      How did i know/identify my input is in = a b c d or a,b,c,d

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      @@piyushpanchal046 In the question format of input will be given.

  • @AbhishekVuppala-sr7tg
    @AbhishekVuppala-sr7tg 3 місяці тому

    Bro..In Normal Python Compiler we give 4 spaces or 1 Tab...
    But u said in TCS python Compiler we 2 spaces is it acceptable...

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому +1

      This is not my suggestion that a candidate try and tell us how to take input.

  • @durgasaiprasadnomula7827
    @durgasaiprasadnomula7827 3 місяці тому

    but this input format will not work if we take 2 digits number like [12,34,56,67,89] it will 12 as 2 digits like 1,2 and all number as same process

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому

      @@durgasaiprasadnomula7827 yes I saw. Check the GitHub i have updated the code. If no then let me know

  • @sarthakkhera3997
    @sarthakkhera3997 5 місяців тому

    Now I get it why my code was not working...I wish I had seen this video earlier😪😪

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      Not a problem, you will get more chances. Be prepare for that. 😊

  • @iamsky.20
    @iamsky.20 5 місяців тому

    will it work for values like [24,12,8,56767] ?? i mean double/triple digit value ?

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      Yes

    • @pratyushnandan7348
      @pratyushnandan7348 5 місяців тому

      No the code which u gave in java , is only taking single digits , coz u are going to each value of string and converting it to int , then how to do for digit numbers?

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      @@pratyushnandan7348 yes, In that case we need to traverse over the array according to ','. I will make necessary changes thanks for letting me know.

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      @@pratyushnandan7348 This format will not appear in any examination. So prepare for the basic format, try catch is the worst you can do.

    • @pratyushnandan7348
      @pratyushnandan7348 5 місяців тому

      @@PrimeCoding19 can you please, explain in detail or give some source from where I can study, the try catch input taking

  • @vinayb5076
    @vinayb5076 4 місяці тому

    I've failed my first ever coding round because I didn't know how to take an array as input which was given in space separated order, even though I knew the efficient logic to solve the problem it was of no use for me. 😢

    • @PrimeCoding19
      @PrimeCoding19  4 місяці тому

      No an issue more opportunity will come. try to prepare for that.
      Stay updated with my channel all genuine opening will be posted on this channel.

  • @utkarshkavitkar7088
    @utkarshkavitkar7088 3 місяці тому

    Comma separated input code in c++ is not working, it is giving output=0.

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому

      Please check code in github.

    • @Goku-dk4mr
      @Goku-dk4mr 3 місяці тому

      what to do ?

    • @Goku-dk4mr
      @Goku-dk4mr 3 місяці тому

      @@PrimeCoding19 bro code is giving 0, I have tommorow exam please reply

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому

      @@Goku-dk4mr vector input_comma_separated() {
      vector arr;
      string input;
      getline(cin, input);
      stringstream ss(input);
      int num;
      char c;
      while (ss >> num) {
      arr.push_back(num);
      ss >> c; // Skip the comma
      }
      return arr;
      }

    • @PrimeCoding19
      @PrimeCoding19  3 місяці тому +1

      @@utkarshkavitkar7088 i have updated the GitHub repository

  • @aditidobriyal1319
    @aditidobriyal1319 5 місяців тому

    C++ code is not working for input like [12,34,3,87]

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому

      Thanks for reaching out it was minor bug,
      Try this out I have made the changes in code file too:-
      vector input_array_format() {
      vector arr;
      string input;
      getline(cin, input);
      stringstream ss(input);
      char c;
      while (ss >> c) {
      if (c != ',' || c != '[' or c != ']') {
      int num;
      ss >> num;
      arr.push_back(num);
      }
      }
      return arr;
      }

  • @Harshsingh31102
    @Harshsingh31102 5 місяців тому +2

    Normal way of taking input does not work, in TCS compiler(for c++)?

    • @PrimeCoding19
      @PrimeCoding19  5 місяців тому +2

      Hi Harsh, It works when you are taking inputs as per given instructions but for worst case scenario I have taught each condition.