CodeGym/Java Tasks/Tracking changes

Tracking changes

  • 20
  • Locked
Read 2 file names from the console: file1 and file2. Both files contain text, but file2 is an updated version of file1. Some of the lines are still the same. You need to create a merged version of the lines by writing them to the lines list. The ADDED and REMOVED labels can't be used consecutively—t
You can't complete this task, because you're not signed in.
Comments (39)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Pavel281185 Backend Developer at Aricoma
31 August 2024, 11:33
Another task where CodeGym solution is too complicated and long, unfortunately validator does not take different right solution like valid.
Hoist
Level 7 , San Diego, United States
5 February 2024, 23:11
Codegym needs to read these comments -- advanced people are leaving due to frustration --- there is a fine line between learning and punishing difficulty / translation / understanding --- personally I don't want to struggle and sweat it out that much in my personal Skill Up time )) You do you
Ilie Babcenco Java Developer at Iucosoft Pro
9 September 2023, 09:44
Actually is not so complicated: 1. Read file names and create BufferedReaders for them; 2. Create two lists (would be easier to compare the strings); 3. Collect the lines from the files to lists; 4. Create a loop with three conditions (if-elseif-elseif): 1) if the lines from the lists are equal the create the Type.Same and add it to the lines; 2) if the second list (built based on the second file) does NOT containt the element from the first list then create a Type.REMOVED; 3) if the first list (built based on the first file) does NOT containt the element from the second list then create a Type.ADDED; 5. Two more loops are needed just two finish the iterations if the created indexes are smaller than lists size; 1) if first index is smaller than first list size then iterate and add new lines with Type.REMOVED 2) if second index is smaller than second list size then iterate and add new lines with Type.ADDED. You'll have to think about how to iterate through the main loop.
Vojtech Jemelka
Level 31 , Czech Republic
4 April 2024, 10:17
I am not sure, what you mean with point 5. Can you explain more detailed?
Vadim “迪姆哥”
Level 35 , Kazakhstan
9 July 2023, 18:12
The task description is a mess... Please clarify: 1. What kind of comparison we need to implement? Sequential: Compare line1 of both files, then line2 of both files, or Random: all lines of file1 with all lines of file2? 2. If only one character of lines is differ how we count that? REMOVED? ADDED? 3. What if both files contains same text on different lines(in file1 is line 1, but in file2 is line 4), how we count that situation? REMOVED? ADDED?
Олег Байбула
Level 32 , Ukraine
Expert
4 March 2023, 06:57
This task is completely unclear. I wouldn't waste my time.
matemate123
Level 50 , Kraków, Poland
31 January 2023, 19:09
It was not easy at all!! At beginning I don't know what's going on, what I'll have do. A few hours reading help section, after that when I haven't computer access I write code with pen and paper and thats what help me understand and create my algorithm. Programmers must have guts and balls. Psychic is crucial in this learning process. Sometimes is hard, not to give up. But remember, if you are on this level, you can be programmer sooner or later!! Don't give up.
Hoist
Level 7 , San Diego, United States
5 February 2024, 23:13
TRUTH --- That right there lol
Adam Odoj
Level 22 , Poland
19 January 2023, 17:10
I´ve just see my work being accepted. I made it with 2 ArrayLists and one " for" loop with some "if"s and "else if"s, 9 lines of code more then CodeGym. I just have one question, How guys can see how many times it was completed??? On my page does not appears such stats. ????????????
Youssef Amajout Talidni Future Java DEV
18 November 2023, 09:28
You're using IntelliJ, right? after you validate your solution and get the green flag it shows you how many did it
Tasmoda Android Developer
19 August 2022, 19:54
8 hours in, on the 2nd day of battling with task 1. Total it's 14 hours on task 1. Trying again tomorrow, still very stuck😭
Melody Ye
Level 29 , France, France
21 May 2023, 01:59
Why don't you just check the correct answer and get a glimpse of hints?
Hoist
Level 7 , San Diego, United States
5 February 2024, 23:07
No one wants to disclose that they check -- Git - AI - Codepilot etc ... too much Tech pride ...
Hoist
Level 7 , San Diego, United States
5 February 2024, 23:08
So many people here with huge tenacity or way more code experience ... ))
Tasmoda Android Developer
18 August 2022, 21:34
I'm 6 hours in🤣😂... Guess what? Still super stuck😂
Hoist
Level 7 , San Diego, United States
5 February 2024, 23:05
Codegym senior management doesn't seem to be reading these comments --- it's too punishing too often to decipher the Task requirements ... people are leaving ... $$$ out the door --- CG needs a Translator that is soooo much less technical / engineer to explain
Justin Smith
Level 41 , Greenfield, USA, United States
30 October 2021, 18:12
Incredibly confusing task conditions but somehow I got this one on my first attempt! Always good to check the official solution afterwards anyway to see if there are a few coding shortcuts, and yes there were!