6 kyu

Shorter Path

372 of 605Nancy27

Description:

You are given a list of directions in the form of a list:

goal = ["N", "S", "E", "W"]

Pretend that each direction counts for 1 step in that particular direction.

Your task is to create a function called directions, that will return a reduced list that will get you to the same point.The order of directions must be returned as N then S then E then W.

If you get back to beginning, return an empty array.

Fundamentals

Stats:

CreatedJan 21, 2016
PublishedJan 22, 2016
Warriors Trained1146
Total Skips98
Total Code Submissions2269
Total Times Completed605
Python Completions372
C# Completions107
Java Completions143
Total Stars26
% of votes with a positive feedback rating92% of 197
Total "Very Satisfied" Votes171
Total "Somewhat Satisfied" Votes21
Total "Not Satisfied" Votes5
Total Rank Assessments56
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Nancy27 Avatar
  • Nicole20 Avatar
  • Voile Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • saudiGuy Avatar
Ad