Комментарии:
Thank you for the hack, but how would you approach this without the copying that you did, like in a test situation?
ОтветитьI don't like this type of problem, I prefer problems that you can come up with a resolution using only the information provided and reasoning. If a person never heard of magic squares, even if this person has a high IQ, he/she would take a long time to figure out these 8 possibilities. I guess almost no one could come up if these 8 magic squares intuitively using only reasoning. At Hackerrank this problem has a success rate of 77%, either they are all genius, or they at least look up the 8 magic squares on the internet. :P
ОтветитьThank you. I had been stuck with this problem for a week and quit HackerRank for a few months and now I can continue.
ОтветитьExplanation is good but stop putting useless background tunes
Ответитьplease continue making videos!!
Ответить🖤
ОтветитьGreat! But I would use a list of 2D arrays. That way you can find the cost simply by getting the same positions like: s[i][k] - squares[i][j]
ОтветитьHey! Great work man you should continue making videos.
ОтветитьThank you very much for this solution
Ответитьwhy there is background music
ОтветитьI wish it was in JavaScript but still helps .....
ОтветитьGreat Thanks for the solution
ОтветитьCan this only be solved by manually solving the magic square beforehand and stashing it as data? What if it was a 4x4 or a 9x9 square, how would you compute the target value each row, column, diagonal would need to equate?
Also, may I suggest you access your 2D-arrays in a consistent manner? Viewers are here to grasp the logic of the problem and thought process to solving it and don't need to be distracted by coding styles