Accepted solution for problem #6 zigzag conversion.

This commit is contained in:
2026-03-16 22:04:38 +01:00
parent 16a981f6df
commit 2a2b2c17da
2 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestZigZagConvert3(t *testing.T) {
input := "PAYPALISHIRING"
expected := "PAHNAPLSIIGYIR"
res := ZigZagConvert(input, 3)
assert.Equal(t, expected, res)
}
func TestZigZagConvert4(t *testing.T) {
input := "PAYPALISHIRING"
expected := "PINALSIGYAHRPI"
res := ZigZagConvert(input, 4)
assert.Equal(t, expected, res)
}