Minimum Penalty Path Discussions | Algorithms | HackerRank
  • + 1 comment

    I am using Djikstra from the source vertex and at each step instead of adding the current distance of a node to the edge weight joining it to another I am taking bitwise OR. Then I am printing minimum distance so obtained to point B. Test cases 0-4 and 6-9 are working, rest say wrong answer. Can Someone suggest a mistake in the approach?