---
title: "Discussion on \"LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go\n\" | Hashnode"
description: "Discussion on \"LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go\n\". LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go"
url: "https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go](https://ferztyle.me/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go?utm_source=hashnode&utm_medium=feed)

LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go

Aug 5 · 15 min read · ferztyle.me  
Read the article

-   [#golang](https://hashnode.com/tag/golang)
-   [#coding](https://hashnode.com/tag/coding)
-   [#coding-challenge](https://hashnode.com/tag/coding-challenge)

## Written by

[Fer](https://hashnode.com/@ferztyle)

@ferztyle · Asuncion, Paraguay

  
[View profile](https://hashnode.com/@ferztyle)

Sr. DevOps/SRE

Hey, I'm Fer, a Senior SRE/DevOps engineer based in Asunción, Paraguay. My day-to-day life is at the intersection of cloud infrastructure, automation, and reliability, working with AWS, Kubernetes, and the tools that keep systems running at scale. A while back, I decided to go deeper into Go. Not just as a scripting language to replace Bash, but as a proper engineering discipline, learning how to design clean systems, write idiomatic Golang code, and build tools that last.

## Responses 3

Markdown supported · ⌘↵ to post

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Aug 5](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa)

The constraint-first choice between \[\]byte and \[\]rune is exactly the right lesson. One additional boundary is that a rune is a Unicode code point, not necessarily a user-perceived character: combining marks and emoji sequences can still span multiple runes. For this ASCII problem \[\]byte is both simpler and faster; for production text, the requirement should say whether it operates on bytes, code points, or grapheme clusters. That specification matters more than choosing the most Unicode-looking type.

[Fer](https://hashnode.com/@ferztyle)

[Aug 5](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa#reply-6a7396e969cacd27978e1ec8)

Yes! Correct! Specification always comes first.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Aug 6](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa#reply-6a7428a641355cea3ad05e5f)

Exactly. I like using this as a small API-design exercise: name the text unit in the function contract first, then choose the representation and tests. A few cases with combining accents and family emoji make the ambiguity obvious immediately.
