"""第 23 课补全练习：检查重复的句尾。修改 solve，保持下方检查不变。"""
import math, io, argparse
import torch
from torch import nn
from torch.nn import functional as F
torch.set_num_threads(2)
torch.manual_seed(26)

def solve(lines):
    endings=[line.rstrip('，。')[-1] for line in lines]
    return len(endings)-len(set(endings))

assert solve(['春风归，','明月回。','江水流，','故人归。'])==1
print("本课补全练习通过。")
