func (rope *Rope) isLeaf() bool {
	return rope.left == nil
}
isLeaf returns true if the rope is a leaf.
package rope
import (
	"bytes"
	"encoding/json"
	"fmt"
	"unicode/utf8"
)
type Rope struct {
	value  []rune
	weight int
	length int
	left   *Rope
	right  *Rope
}