Help Led matix isn't lighting up correctly Is it a Hardware or software issue?
A circuit diagram of what vyou thing you are doing and a 1st check your eyes :-).
You have 6 LEDs lit,not 5, which is MUCH easier to explain.
The two adjacent groups appear to be being driven in parallel.
ie if keys are on columns 1,3,5 then rows 1 &amp; 2 are connected, either in code or on the circuit board.  

With only 10 wires and 25 LEDs you have 5 columns and 5 row drives.
LEDS 1-5, 6-10, 11-15, ...  are connected to columns 1 2 3 4 5 repeatedly and row connections are.
Row 1 = LEDS 1 6 11 16 ...
Row 2 = LEDS 2 7 12 17 ...
...
Row 5 = LEDS 5 10 15 ...

I should have looked at picture 1 first.
Your basic connections look correct as above.

There may be no "N Key rollover issue as the LEDs ARE the diodes you need to stop NKR.

Sounds like software.

Trouble shooting hardware.  

Activate 1 row-column at a time using the 10 wires driving at the connection point to the microcontroller.  

C 1 2 3 4 5 one at a time with R1 should give a sequence of the 1st 5 LEDs.
Same with C 1 2 3 4 5 and Row 2.
Then try several R or C at once to see how it should behave.



Glances at code - not obvious how pin by pin is set.
Why is limit 48?
= 72_10?