A Learning-based Resource Slicing Algorithm to Achieve URLLC in Vehicle-to-Vehicle Networks