Can anyone help me with this problem?
Difference between en4 and en5, changed 8 character(s)
Given a map of a dungeon, your task is to take all **TWO** diamonds in the dungeon.↵
Find the minimum number of gates you have to open to take all the diamonds.↵
Note: It can be more than one gate to go into the dungeon from the outside.↵
You can move up, down, left, right or diagonal↵
&mdash; The letter '.' means blank space, you can move on it↵
&mdash; The letter '*' means blockade, you have to go around it↵
&mdash; The letter '#' means there's a gate at that place, you need it opened to go through it↵
&mdash; The letter '$' means the diamond.↵ Input format:↵ &mdash; First line is two number N and M &mdash; the dungeon has the size N*M.↵ &mdash; N lines following, represent the map of the dungeon.↵ Output format:↵ &mdash; A single integer &mdash; the minimum number of gates you have to open.↵ Example input:↵ 5 9↵ ****#****↵ *..#.#..*↵ ****.****↵ *$#.#.#\$*↵

*********↵

Example output:↵
4↵

Thank you guys, hope you have a great standing in the next contest.

#### History

Revisions

Rev. Lang. By When Δ Comment
en11 thanhchauns2 2021-05-14 09:46:39 13 Tiny change: 'eft, right or diagonal\n\nAbout ' -> 'eft, right.\n\nAbout '
en10 thanhchauns2 2021-05-14 09:38:15 28
en9 thanhchauns2 2021-05-14 09:36:35 44
en8 thanhchauns2 2021-05-14 09:13:31 95
en7 thanhchauns2 2021-05-14 09:12:17 173
en6 thanhchauns2 2021-05-14 09:08:50 86
en5 thanhchauns2 2021-05-14 09:07:47 8
en4 thanhchauns2 2021-05-14 09:07:31 42 Reverted to en1
en3 thanhchauns2 2021-05-14 09:07:07 40 (published)
en2 thanhchauns2 2021-05-14 09:06:15 2 Tiny change: 'tput:\n4\nThank yo' -> 'tput:\n4\n\nThank yo' (saved to drafts)
en1 thanhchauns2 2021-05-14 09:06:00 1039 Initial revision (published)