Day 3: Find the Day
-
rajan_kr 9 years ago There is something wrong with Laderborad of this contest. It is considering submission time also in ranking. Not just the total sum of scores.
-
PRASHANTB1984 9 years ago Don't worry about the timing, this is more of a learning session.
-
Geoff_Fitz 9 years ago how is timing calculated since mine states that its 9743 but just started yesterday?
-
rajan_kr 9 years ago Same here Man. I am still unable to figure out why my rank is automatically getting lower. I have already submitted solutions but i am being overtaken by others who are submitting solutions after me. Can anyone tell me how timing is calculated?
-
-
Velvet 9 years ago Will you explain to me the process of ranking ? When I correctly submitted(all testcases of every problem passed) the last solution of the problems till now, my rank showed 728. Now, after a few hours I have logged in, and I find my rank at 1360. How is that possible when I have already completed all the challenges given here so far correctly ?
-
rajan_kr 9 years ago Same is happening with me too. I have no idea how they are ranking.
-
-
-
-
trendsetter37 9 years ago Wow, Date objects using 0 based month indices really got me on this one. Hint, hint.
-
Mercury888 9 years ago Thanks, that's what I needed to solve this one.
-
ray10mathew 9 years ago If not for this comment I would never have solved it - I would've assumed that something was wrong with my code. Thanks
-
markhaur 3 years ago This thing got me for almost an hour... until i printed the dates after a lot of search...
-
-
[deleted] 9 years ago I started a GIT branch for those who need a little help let me know if you need explanations added as well https://github.com/giannioudis/7-Days-of-JavaScript
-
PRASHANTB1984 9 years ago That is really great! Thank you for sharing.
-
c071143 9 years ago That's a really decent code !
-
[deleted] 9 years ago thanks! I try to micic my Java and C# code. Less is more i find.
-
-
-
vinayprajapati31 3 years ago //This code passed all test
var d = new Date(myDate); var dayNames =["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; console.log(dayNames[d.getDay()]);
-
ameyb2018 6 years ago Here is my code for the same - function findDay(myDate) { // Return day for date myDate(MM/DD/YYYY) // Note that myDate contains the date in string format var d = new Date(myDate); //var stringDay = myDate[3]+myDate[4]; // var day = parseInt(stringDay); d = d.getDay();
var weekdays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; if(d!=-1) { console.log(weekdays[d]); }
}
// tail starts here process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; });
process.stdin.on("end", function () { var dates = _input.split('\n');
for (var i = 0; i < dates.length - 1; i++) { findDay(dates[i]); }
});
Sort 25 Discussions, By:
Please Log In in order to post a comment